Browse Source

usbutils semun use proper def for linux which fixes OSX also

nfactor-troky
Kano 12 years ago
parent
commit
8c1366113c
  1. 15
      usbutils.c

15
usbutils.c

@ -2569,15 +2569,18 @@ void usb_initialise()
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/sem.h> #include <sys/sem.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#ifndef __APPLE__
union semun { union semun {
int sem; int val;
struct semid_ds *seminfo; struct semid_ds *buf;
ushort *all; unsigned short *array;
struct seminfo *__buf;
}; };
#endif
#else #else
static LPSECURITY_ATTRIBUTES unsec(LPSECURITY_ATTRIBUTES sec) static LPSECURITY_ATTRIBUTES unsec(LPSECURITY_ATTRIBUTES sec)
{ {
@ -2766,7 +2769,7 @@ fail:
return false; return false;
} }
opt.seminfo = &seminfo; opt.buf = &seminfo;
count = 0; count = 0;
while (++count) { while (++count) {
// Should NEVER take 100ms // Should NEVER take 100ms
@ -2782,7 +2785,7 @@ fail:
dname, sem, name, count, errno, strerror(errno)); dname, sem, name, count, errno, strerror(errno));
return false; return false;
} }
if (opt.seminfo->sem_otime != 0) if (opt.buf->sem_otime != 0)
break; break;
nmsleep(1); nmsleep(1);
} }

Loading…
Cancel
Save