aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libbb.h13
-rw-r--r--libbb/xfuncs_printf.c12
2 files changed, 13 insertions, 12 deletions
diff --git a/include/libbb.h b/include/libbb.h
index f9f28f983..7a8bfdffb 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1019,16 +1019,17 @@ extern int update_passwd(const char *filename, const char *username,
1019/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */ 1019/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
1020int get_terminal_width_height(int fd, int *width, int *height); 1020int get_terminal_width_height(int fd, int *width, int *height);
1021 1021
1022int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); 1022/* NB: "unsigned request" is crucial! "int request" will break some arches! */
1023int ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5))); 1023int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
1024int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
1024#if ENABLE_IOCTL_HEX2STR_ERROR 1025#if ENABLE_IOCTL_HEX2STR_ERROR
1025int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name); 1026int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name);
1026int bb_xioctl(int fd, int request, void *argp, const char *ioctl_name); 1027int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name);
1027#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request) 1028#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp,#request)
1028#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp,#request) 1029#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp,#request)
1029#else 1030#else
1030int bb_ioctl_or_warn(int fd, int request, void *argp); 1031int bb_ioctl_or_warn(int fd, unsigned request, void *argp);
1031int bb_xioctl(int fd, int request, void *argp); 1032int bb_xioctl(int fd, unsigned request, void *argp);
1032#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp) 1033#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,argp)
1033#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp) 1034#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp)
1034#endif 1035#endif
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index dd8687dc6..d3fb39f04 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -451,7 +451,7 @@ void selinux_or_die(void)
451#endif 451#endif
452} 452}
453 453
454int ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...) 454int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
455{ 455{
456 int ret; 456 int ret;
457 va_list p; 457 va_list p;
@@ -467,7 +467,7 @@ int ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...
467 return ret; 467 return ret;
468} 468}
469 469
470int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...) 470int ioctl_or_perror(int fd, unsigned request, void *argp, const char *fmt,...)
471{ 471{
472 va_list p; 472 va_list p;
473 int ret = ioctl(fd, request, argp); 473 int ret = ioctl(fd, request, argp);
@@ -481,7 +481,7 @@ int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...)
481} 481}
482 482
483#if ENABLE_IOCTL_HEX2STR_ERROR 483#if ENABLE_IOCTL_HEX2STR_ERROR
484int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name) 484int bb_ioctl_or_warn(int fd, unsigned request, void *argp, const char *ioctl_name)
485{ 485{
486 int ret; 486 int ret;
487 487
@@ -490,7 +490,7 @@ int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name)
490 bb_simple_perror_msg(ioctl_name); 490 bb_simple_perror_msg(ioctl_name);
491 return ret; 491 return ret;
492} 492}
493int bb_xioctl(int fd, int request, void *argp, const char *ioctl_name) 493int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name)
494{ 494{
495 int ret; 495 int ret;
496 496
@@ -500,7 +500,7 @@ int bb_xioctl(int fd, int request, void *argp, const char *ioctl_name)
500 return ret; 500 return ret;
501} 501}
502#else 502#else
503int bb_ioctl_or_warn(int fd, int request, void *argp) 503int bb_ioctl_or_warn(int fd, unsigned request, void *argp)
504{ 504{
505 int ret; 505 int ret;
506 506
@@ -509,7 +509,7 @@ int bb_ioctl_or_warn(int fd, int request, void *argp)
509 bb_perror_msg("ioctl %#x failed", request); 509 bb_perror_msg("ioctl %#x failed", request);
510 return ret; 510 return ret;
511} 511}
512int bb_xioctl(int fd, int request, void *argp) 512int bb_xioctl(int fd, unsigned request, void *argp)
513{ 513{
514 int ret; 514 int ret;
515 515