1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
--- busybox-1.10.1/include/libbb.h Sat Apr 19 05:50:36 2008
+++ busybox-1.10.1-ioctl/include/libbb.h Thu Apr 24 06:45:03 2008
@@ -995,16 +995,16 @@
/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
int get_terminal_width_height(int fd, int *width, int *height);
-int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
-void ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
+int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
+void ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
#if ENABLE_IOCTL_HEX2STR_ERROR
-int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name);
-void bb_xioctl(int fd, int request, void *argp, const char *ioctl_name);
+int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name);
+void bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name);
#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request)
#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp,#request)
#else
-int bb_ioctl_or_warn(int fd, int request, void *argp);
-void bb_xioctl(int fd, int request, void *argp);
+int bb_ioctl_or_warn(int fd, unsigned request, void *argp);
+void bb_xioctl(int fd, unsigned request, void *argp);
#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp)
#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp)
#endif
--- busybox-1.10.1/libbb/xfuncs.c Sat Apr 19 05:50:33 2008
+++ busybox-1.10.1-ioctl/libbb/xfuncs.c Thu Apr 24 06:45:14 2008
@@ -704,7 +704,7 @@
return ret;
}
-void ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...)
+void ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
{
va_list p;
@@ -717,7 +717,7 @@
}
}
-int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...)
+int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
{
va_list p;
int ret = ioctl(fd, request, argp);
@@ -731,7 +731,7 @@
}
#if ENABLE_IOCTL_HEX2STR_ERROR
-int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name)
+int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name)
{
int ret;
@@ -740,13 +740,13 @@
bb_simple_perror_msg(ioctl_name);
return ret;
}
-void bb_xioctl(int fd, int request, void *argp, const char *ioctl_name)
+void bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name)
{
if (ioctl(fd, request, argp) < 0)
bb_simple_perror_msg_and_die(ioctl_name);
}
#else
-int bb_ioctl_or_warn(int fd, int request, void *argp)
+int bb_ioctl_or_warn(int fd, unsigned request, void *argp)
{
int ret;
@@ -755,7 +755,7 @@
bb_perror_msg("ioctl %#x failed", request);
return ret;
}
-void bb_xioctl(int fd, int request, void *argp)
+void bb_xioctl(int fd, unsigned request, void *argp)
{
if (ioctl(fd, request, argp) < 0)
bb_perror_msg_and_die("ioctl %#x failed", request);
|