mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
tentative fix for ppc64 problems with ioctl.
Zero code size impact.
This commit is contained in:
parent
01eaee9309
commit
5bb2fc2dc1
@ -1019,16 +1019,17 @@ extern int update_passwd(const char *filename, const char *username,
|
|||||||
/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
|
/* 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 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)));
|
/* NB: "unsigned request" is crucial! "int request" will break some arches! */
|
||||||
int 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)));
|
||||||
|
int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) __attribute__ ((format (printf, 4, 5)));
|
||||||
#if ENABLE_IOCTL_HEX2STR_ERROR
|
#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 bb_xioctl(int fd, int request, void *argp, const char *ioctl_name);
|
int 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 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)
|
#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp,#request)
|
||||||
#else
|
#else
|
||||||
int bb_ioctl_or_warn(int fd, int request, void *argp);
|
int bb_ioctl_or_warn(int fd, unsigned request, void *argp);
|
||||||
int bb_xioctl(int fd, int request, void *argp);
|
int bb_xioctl(int fd, unsigned request, void *argp);
|
||||||
#define ioctl_or_warn(fd,request,argp) bb_ioctl_or_warn(fd,request,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)
|
#define xioctl(fd,request,argp) bb_xioctl(fd,request,argp)
|
||||||
#endif
|
#endif
|
||||||
|
@ -451,7 +451,7 @@ void selinux_or_die(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...)
|
int ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
va_list p;
|
va_list p;
|
||||||
@ -467,7 +467,7 @@ int ioctl_or_perror_and_die(int fd, int request, void *argp, const char *fmt,...
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
va_list p;
|
||||||
int ret = ioctl(fd, request, argp);
|
int ret = ioctl(fd, request, argp);
|
||||||
@ -481,7 +481,7 @@ int ioctl_or_perror(int fd, int request, void *argp, const char *fmt,...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_IOCTL_HEX2STR_ERROR
|
#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;
|
int ret;
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ int bb_ioctl_or_warn(int fd, int request, void *argp, const char *ioctl_name)
|
|||||||
bb_simple_perror_msg(ioctl_name);
|
bb_simple_perror_msg(ioctl_name);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int bb_xioctl(int fd, int request, void *argp, const char *ioctl_name)
|
int bb_xioctl(int fd, unsigned request, void *argp, const char *ioctl_name)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ int bb_xioctl(int fd, int request, void *argp, const char *ioctl_name)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
#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;
|
int ret;
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ int bb_ioctl_or_warn(int fd, int request, void *argp)
|
|||||||
bb_perror_msg("ioctl %#x failed", request);
|
bb_perror_msg("ioctl %#x failed", request);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int bb_xioctl(int fd, int request, void *argp)
|
int bb_xioctl(int fd, unsigned request, void *argp)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user