1 Index: console-tools/deallocvt.c
2 ===================================================================
3 --- console-tools/deallocvt.c (revision 18902)
4 +++ console-tools/deallocvt.c (working copy)
5 @@ -31,8 +31,7 @@ int deallocvt_main(int argc, char **argv
9 - if (-1 == ioctl(get_console_fd(), VT_DISALLOCATE, num)) {
10 - bb_perror_msg_and_die("VT_DISALLOCATE");
12 + xioctl(get_console_fd(), VT_DISALLOCATE, num);
17 ===================================================================
18 --- libbb/xfuncs.c (revision 18902)
19 +++ libbb/xfuncs.c (working copy)
20 @@ -639,3 +639,13 @@ int get_terminal_width_height(const int
25 +/* Die if the ioctl() call failed. Only support the 3 arg form. */
27 +int xioctl(int fd, int request, unsigned long arg)
29 + int ret = ioctl(fd, request, arg);
31 + bb_perror_msg_and_die("ioctl");
34 Index: miscutils/raidautorun.c
35 ===================================================================
36 --- miscutils/raidautorun.c (revision 18902)
37 +++ miscutils/raidautorun.c (working copy)
38 @@ -19,9 +19,7 @@ int raidautorun_main(int argc, char **ar
42 - if (ioctl(xopen(argv[1], O_RDONLY), RAID_AUTORUN, NULL) != 0) {
43 - bb_perror_msg_and_die("ioctl");
45 + xioctl(xopen(argv[1], O_RDONLY), RAID_AUTORUN, NULL);
49 Index: include/libbb.h
50 ===================================================================
51 --- include/libbb.h (revision 18902)
52 +++ include/libbb.h (working copy)
53 @@ -249,7 +249,8 @@ DIR *warn_opendir(const char *path);
54 char *xrealloc_getcwd_or_warn(char *cwd);
55 char *xmalloc_readlink_or_warn(const char *path);
56 char *xmalloc_realpath(const char *path);
58 +int xioctl(int fd, int request, unsigned long arg);
59 +#define xioctl(fd,request,arg) xioctl(fd,request,(unsigned long)arg)
61 //TODO: signal(sid, f) is the same? then why?
62 extern void sig_catch(int,void (*)(int));