mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 07:59:42 +00:00
(Wiiu) Cleanups
This commit is contained in:
parent
d2c3a6d71e
commit
2364fdd900
@ -101,23 +101,25 @@ int _gettimeofday_r(struct _reent *ptr,
|
||||
int clock_gettime(clockid_t clk_id, struct timespec* tp)
|
||||
{
|
||||
struct timeval ptimeval = { 0 };
|
||||
int ret = 0;
|
||||
OSTime cosTime;
|
||||
int ret = 0;
|
||||
|
||||
if (tp == NULL) {
|
||||
if (tp == NULL)
|
||||
{
|
||||
errno = EFAULT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (clk_id) {
|
||||
switch (clk_id)
|
||||
{
|
||||
case CLOCK_REALTIME:
|
||||
/* Just wrap gettimeofday. Cheating, I know. */
|
||||
ret = _gettimeofday_r(NULL, &ptimeval, NULL);
|
||||
if (ret) return -1;
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
tp->tv_sec = ptimeval.tv_sec;
|
||||
tp->tv_sec = ptimeval.tv_sec;
|
||||
tp->tv_nsec = ptimeval.tv_usec * 1000;
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
@ -144,12 +146,15 @@ static struct ifaddrs *buildEmptyIfa(void)
|
||||
if (result)
|
||||
{
|
||||
memset(result, 0, sizeof(struct ifaddrs));
|
||||
result->ifa_name = strdup(wiiu_iface_name);
|
||||
result->ifa_addr = (struct sockaddr *)malloc(sizeof(struct sockaddr_in));
|
||||
result->ifa_name = strdup(wiiu_iface_name);
|
||||
result->ifa_addr = (struct sockaddr *)malloc(sizeof(struct sockaddr_in));
|
||||
result->ifa_netmask = (struct sockaddr *)malloc(sizeof(struct sockaddr_in));
|
||||
result->ifa_dstaddr = (struct sockaddr *)malloc(sizeof(struct sockaddr_in));
|
||||
|
||||
if (!result->ifa_name || !result->ifa_addr || !result->ifa_netmask || !result->ifa_dstaddr)
|
||||
if ( !result->ifa_name ||
|
||||
!result->ifa_addr ||
|
||||
!result->ifa_netmask ||
|
||||
!result->ifa_dstaddr)
|
||||
goto error;
|
||||
|
||||
memset(result->ifa_addr, 0, sizeof(struct sockaddr_in));
|
||||
|
Loading…
Reference in New Issue
Block a user