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 <ldv@altlinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2012-02-25 15:19:02 +01:00
parent 1a3cf10c30
commit aa925db236
8 changed files with 6 additions and 37 deletions

View 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

4
defs.h
View File

@ -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);

1
file.c
View File

@ -1822,7 +1822,6 @@ osf_fstatfs(struct tcb *tcp)
}
#endif
/* directory */
int
sys_chdir(struct tcb *tcp)

View File

@ -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:

View 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

View File

@ -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

View File

@ -43,13 +43,6 @@
#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 },

2
util.c
View File

@ -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++;