]> granicus.if.org Git - strace/commitdiff
Remove a few more code parts which are unused on Linux
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 25 Feb 2012 14:19:02 +0000 (15:19 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 25 Feb 2012 14:19:02 +0000 (15:19 +0100)
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 <ldv@altlinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Makefile.am
defs.h
file.c
ioctl.c
resource.c
signal.c
stream.c
util.c

index d9c479545b622168cf671bd44d7e41722dfeb4f0..97cd43b88d08e8100e7189846409310757927339 100644 (file)
@@ -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 e7e1ebb3717e36a41f61da49cf8c58ab2163d6bd..67cd5c3afbb1294e36692e46c5e35b8a1c52cd70 100644 (file)
--- 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/<ARCH>/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 eef9436a0f22416c85305893e8cbc0dfea344ea3..b4cb62631cbac8f7d6c9b61eb5e47a239eb162a1 100644 (file)
--- 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 5bec5e758d9a714003edac66e86b3683fa8a6b2b..0ea6b2e5239ae9b2a12f136c31882e76e38a2f31 100644 (file)
--- 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:
index 4f20f1a59791b0b1a75da0c8b2103db93b1b1145..8f3ca1aa153f03a8a3ea26e7c2364a5ed15fb3ce 100644 (file)
@@ -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
index 89a44ffe889debe79076d3b68a97802d35550c7a..4f7daf3e57cea1037d1aa2d306eccb9461d0b49e 100644 (file)
--- 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
index d2b7454d56c839bbb6c699f4c5fd6e87e90d2fb0..6e0d38dc735dfdad7acdd87deed04e359de20f70 100644 (file)
--- a/stream.c
+++ b/stream.c
 #ifdef HAVE_SYS_CONF_H
 #include <sys/conf.h>
 #endif
-#ifdef HAVE_SYS_STREAM_H
-#include <sys/stream.h>
-#endif
-#ifdef HAVE_SYS_TIHDR_H
-#include <sys/tihdr.h>
-#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 <sys/tiuser.h>
-#include <sys/sockmod.h>
-#include <sys/timod.h>
-#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 5b38a906296060d0fb8411128047d6037db47a63..d71e9db366174b81452914a7c68d1b9e8b58ab24 100644 (file)
--- 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++;