From: Denys Vlasenko Date: Sat, 25 Feb 2012 14:19:02 +0000 (+0100) Subject: Remove a few more code parts which are unused on Linux X-Git-Tag: v4.7~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa925db23634fe6a2c1d4b47accb3649daf1b781;p=strace Remove a few more code parts which are unused on Linux This change is abapted from Dmitry's changes to remove support for non-Linux architectures. * Makefile.am: Remove if LINUX/endif pairs. * defs.h: Remove stream_ioctl() declaration. * ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block. * resource.c: Use 'defined(FOO)' instead of 'defined FOO' form. * util.c: Likewise. * signal.c: Remove conditional includes which are never used on Linux. * stream.c: Likewise. * file.c: Remove excessive empty lines. Signed-off-by: Dmitry V. Levin Signed-off-by: Denys Vlasenko --- diff --git a/Makefile.am b/Makefile.am index d9c47954..97cd43b8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -118,8 +118,6 @@ $(srcdir)/CREDITS: $(top_srcdir)/CREDITS.in $(top_srcdir)/.mailmap \ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX -if LINUX - IOCTLDIR = /usr/include IOCTLASM = asm @@ -137,9 +135,6 @@ ioctls.h: $(srcdir)/linux/ioctlent.sh ioctldefs.h: ioctls.h ; endif -endif - -if LINUX ioctlent_h = $(builddir)/$(OS)/ioctlent.h BUILT_SOURCES += $(ioctlent_h) @@ -150,5 +145,3 @@ $(ioctlent_h): $(top_builddir)/config.status $(ioctlent_h_deps) cat $(ioctlent_h_deps) | \ $(COMPILE) -E -P - | \ LC_ALL=C sort -u -k3,3 -k2,2 > $@ - -endif diff --git a/defs.h b/defs.h index e7e1ebb3..67cd5c3a 100644 --- a/defs.h +++ b/defs.h @@ -64,8 +64,7 @@ /* Maximum number of args to a syscall. * - * Make sure that all entries in all syscallent.h files - * have nargs <= MAX_ARGS! + * Make sure that all entries in all syscallent.h files have nargs <= MAX_ARGS! * linux//syscallent.h: all have nargs <= 6. */ #ifndef MAX_ARGS @@ -539,7 +538,6 @@ extern int ioctl_decode(struct tcb *, long, long); extern int term_ioctl(struct tcb *, long, long); extern int sock_ioctl(struct tcb *, long, long); extern int proc_ioctl(struct tcb *, int, int); -extern int stream_ioctl(struct tcb *, int, int); extern int rtc_ioctl(struct tcb *, long, long); extern int scsi_ioctl(struct tcb *, long, long); extern int block_ioctl(struct tcb *, long, long); diff --git a/file.c b/file.c index eef9436a..b4cb6263 100644 --- a/file.c +++ b/file.c @@ -1822,7 +1822,6 @@ osf_fstatfs(struct tcb *tcp) } #endif - /* directory */ int sys_chdir(struct tcb *tcp) diff --git a/ioctl.c b/ioctl.c index 5bec5e75..0ea6b2e5 100644 --- a/ioctl.c +++ b/ioctl.c @@ -82,10 +82,6 @@ ioctl_decode(struct tcb *tcp, long code, long arg) return term_ioctl(tcp, code, arg); case 0x89: return sock_ioctl(tcp, code, arg); -#ifdef HAVE_SYS_STREAM_H - case 'S': - return stream_ioctl(tcp, code, arg); -#endif /* HAVE_SYS_STREAM_H */ case 'p': return rtc_ioctl(tcp, code, arg); case 0x03: diff --git a/resource.c b/resource.c index 4f20f1a5..8f3ca1aa 100644 --- a/resource.c +++ b/resource.c @@ -118,7 +118,7 @@ sprintrlim(long lim) return buf; } -# if defined POWERPC64 || defined X86_64 +# if defined(POWERPC64) || defined(X86_64) static void print_rlimit32(struct tcb *tcp) { @@ -152,7 +152,7 @@ sys_getrlimit(struct tcb *tcp) else { if (syserror(tcp) || !verbose(tcp)) tprintf("%#lx", tcp->u_arg[1]); -# if defined POWERPC64 || defined X86_64 +# if defined(POWERPC64) || defined(X86_64) else if (current_personality == 1) print_rlimit32(tcp); # endif @@ -176,7 +176,7 @@ sys_setrlimit(struct tcb *tcp) tprints(", "); if (!verbose(tcp)) tprintf("%#lx", tcp->u_arg[1]); -# if defined POWERPC64 || defined X86_64 +# if defined(POWERPC64) || defined(X86_64) else if (current_personality == 1) print_rlimit32(tcp); # endif diff --git a/signal.c b/signal.c index 89a44ffe..4f7daf3e 100644 --- a/signal.c +++ b/signal.c @@ -138,11 +138,9 @@ struct sigcontext # define NSIG 32 #endif - - #ifdef HAVE_SIGACTION -#if defined I386 || defined X86_64 +#if defined(I386) || defined(X86_64) /* The libc headers do not define this constant since it should only be used by the implementation. So we define it here. */ # ifndef SA_RESTORER @@ -1139,8 +1137,6 @@ sys_sigsuspend(struct tcb *tcp) return 0; } - - #if !defined SS_ONSTACK #define SS_ONSTACK 1 #define SS_DISABLE 2 diff --git a/stream.c b/stream.c index d2b7454d..6e0d38dc 100644 --- a/stream.c +++ b/stream.c @@ -43,13 +43,6 @@ #ifdef HAVE_SYS_CONF_H #include #endif -#ifdef HAVE_SYS_STREAM_H -#include -#endif -#ifdef HAVE_SYS_TIHDR_H -#include -#endif - #ifndef HAVE_STROPTS_H #define RS_HIPRI 1 @@ -62,12 +55,6 @@ struct strbuf { #define MOREDATA 2 #endif /* !HAVE_STROPTS_H */ -#ifdef HAVE_SYS_TIUSER_H -#include -#include -#include -#endif /* HAVE_SYS_TIUSER_H */ - static const struct xlat msgflags[] = { { RS_HIPRI, "RS_HIPRI" }, { 0, NULL }, diff --git a/util.c b/util.c index 5b38a906..d71e9db3 100644 --- a/util.c +++ b/util.c @@ -246,7 +246,7 @@ printxval(const struct xlat *xlat, int val, const char *dflt) int printllval(struct tcb *tcp, const char *format, int llarg) { -# if defined X86_64 || defined POWERPC64 +# if defined(X86_64) || defined(POWERPC64) if (current_personality == 0) { tprintf(format, tcp->u_arg[llarg]); llarg++;