mirror of
https://github.com/libretro/RetroArch
synced 2025-03-06 04:13:52 +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)
|
int clock_gettime(clockid_t clk_id, struct timespec* tp)
|
||||||
{
|
{
|
||||||
struct timeval ptimeval = { 0 };
|
struct timeval ptimeval = { 0 };
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
OSTime cosTime;
|
|
||||||
|
|
||||||
if (tp == NULL) {
|
if (tp == NULL)
|
||||||
|
{
|
||||||
errno = EFAULT;
|
errno = EFAULT;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (clk_id) {
|
switch (clk_id)
|
||||||
|
{
|
||||||
case CLOCK_REALTIME:
|
case CLOCK_REALTIME:
|
||||||
/* Just wrap gettimeofday. Cheating, I know. */
|
/* Just wrap gettimeofday. Cheating, I know. */
|
||||||
ret = _gettimeofday_r(NULL, &ptimeval, NULL);
|
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;
|
tp->tv_nsec = ptimeval.tv_usec * 1000;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
@ -144,12 +146,15 @@ static struct ifaddrs *buildEmptyIfa(void)
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
memset(result, 0, sizeof(struct ifaddrs));
|
memset(result, 0, sizeof(struct ifaddrs));
|
||||||
result->ifa_name = strdup(wiiu_iface_name);
|
result->ifa_name = strdup(wiiu_iface_name);
|
||||||
result->ifa_addr = (struct sockaddr *)malloc(sizeof(struct sockaddr_in));
|
result->ifa_addr = (struct sockaddr *)malloc(sizeof(struct sockaddr_in));
|
||||||
result->ifa_netmask = (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));
|
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;
|
goto error;
|
||||||
|
|
||||||
memset(result->ifa_addr, 0, sizeof(struct sockaddr_in));
|
memset(result->ifa_addr, 0, sizeof(struct sockaddr_in));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user