1
0

some small cleanups

This commit is contained in:
michael 2007-02-25 00:13:06 +00:00
parent 2c0c12554e
commit be452175b8

View File

@ -37,6 +37,7 @@ static pthread_mutex_t int_wait = PTHREAD_MUTEX_INITIALIZER;
#define NO_WINDRVR 1 #define NO_WINDRVR 1
#undef DEBUG #undef DEBUG
#ifdef DEBUG
void hexdump(unsigned char *buf, int len) { void hexdump(unsigned char *buf, int len) {
int i; int i;
@ -46,6 +47,7 @@ void hexdump(unsigned char *buf, int len) {
fprintf(stderr,"\n"); fprintf(stderr,"\n");
} }
} }
#endif
int usb_deviceinfo(unsigned char *buf) { int usb_deviceinfo(unsigned char *buf) {
int i,j,k,l; int i,j,k,l;
@ -512,9 +514,11 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
it->dwCounter = 1; it->dwCounter = 1;
} else { } else {
pthread_mutex_lock(&int_wait); pthread_mutex_lock(&int_wait);
pthread_mutex_unlock(&int_wait);
} }
} else { } else {
pthread_mutex_lock(&int_wait); pthread_mutex_lock(&int_wait);
pthread_mutex_unlock(&int_wait);
} }
#endif #endif
@ -585,8 +589,7 @@ int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
return ret; return ret;
} }
int ioctl(int fd, int request, ...) int ioctl(int fd, int request, ...) {
{
va_list args; va_list args;
void *argp; void *argp;
int ret; int ret;
@ -606,17 +609,14 @@ int ioctl(int fd, int request, ...)
return ret; return ret;
} }
typedef int (*open_funcptr_t) (const char *, int, mode_t); int open (const char *pathname, int flags, ...) {
static int (*func) (const char *, int, mode_t) = NULL;
int open (const char *pathname, int flags, ...)
{
static open_funcptr_t func = NULL;
mode_t mode = 0; mode_t mode = 0;
va_list args; va_list args;
int fd; int fd;
if (!func) if (!func)
func = (open_funcptr_t) dlsym (REAL_LIBC, "open"); func = (int (*) (const char *, int, mode_t)) dlsym (REAL_LIBC, "open");
if (flags & O_CREAT) { if (flags & O_CREAT) {
va_start(args, flags); va_start(args, flags);