From 571744447c23f91feb6439948f3a619aca850dfb Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Thu, 12 Dec 2013 05:09:18 +0000 Subject: include cleanups: remove unused headers and add feature test macros --- src/linux/chroot.c | 1 + src/linux/clock_adjtime.c | 2 -- src/linux/klogctl.c | 1 + src/linux/personality.c | 1 + src/linux/prlimit.c | 3 ++- src/linux/sendfile.c | 2 +- src/linux/setfsgid.c | 2 +- src/linux/setfsuid.c | 2 +- src/linux/setgroups.c | 1 + src/linux/sethostname.c | 1 + src/linux/setns.c | 1 - src/linux/stime.c | 1 + src/linux/sysinfo.c | 3 +-- src/linux/wait4.c | 1 - 14 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/linux') diff --git a/src/linux/chroot.c b/src/linux/chroot.c index 82b4fe7..0e69f14 100644 --- a/src/linux/chroot.c +++ b/src/linux/chroot.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include "syscall.h" diff --git a/src/linux/clock_adjtime.c b/src/linux/clock_adjtime.c index 1fc9bef..056ad6d 100644 --- a/src/linux/clock_adjtime.c +++ b/src/linux/clock_adjtime.c @@ -1,5 +1,3 @@ -#define _GNU_SOURCE -#include #include #include "syscall.h" diff --git a/src/linux/klogctl.c b/src/linux/klogctl.c index 209ae74..8102ee6 100644 --- a/src/linux/klogctl.c +++ b/src/linux/klogctl.c @@ -1,3 +1,4 @@ +#include #include "syscall.h" int klogctl (int type, char *buf, int len) diff --git a/src/linux/personality.c b/src/linux/personality.c index 06851f5..e00cf79 100644 --- a/src/linux/personality.c +++ b/src/linux/personality.c @@ -1,3 +1,4 @@ +#include #include "syscall.h" #ifdef SYS_personality int personality(unsigned long persona) diff --git a/src/linux/prlimit.c b/src/linux/prlimit.c index 1215248..d1639cc 100644 --- a/src/linux/prlimit.c +++ b/src/linux/prlimit.c @@ -1,4 +1,4 @@ -#include +#define _GNU_SOURCE #include #include "syscall.h" #include "libc.h" @@ -8,4 +8,5 @@ int prlimit(pid_t pid, int resource, const struct rlimit *new_limit, struct rlim return syscall(SYS_prlimit64, pid, resource, new_limit, old_limit); } +#undef prlimit64 LFS64(prlimit); diff --git a/src/linux/sendfile.c b/src/linux/sendfile.c index 818b19d..d63f419 100644 --- a/src/linux/sendfile.c +++ b/src/linux/sendfile.c @@ -1,4 +1,4 @@ -#include +#include #include "syscall.h" #include "libc.h" diff --git a/src/linux/setfsgid.c b/src/linux/setfsgid.c index a7ed9e9..ad80422 100644 --- a/src/linux/setfsgid.c +++ b/src/linux/setfsgid.c @@ -1,4 +1,4 @@ -#include +#include #include "syscall.h" #include "libc.h" diff --git a/src/linux/setfsuid.c b/src/linux/setfsuid.c index 1509e0a..8635873 100644 --- a/src/linux/setfsuid.c +++ b/src/linux/setfsuid.c @@ -1,4 +1,4 @@ -#include +#include #include "syscall.h" #include "libc.h" diff --git a/src/linux/setgroups.c b/src/linux/setgroups.c index 9758940..1248fdb 100644 --- a/src/linux/setgroups.c +++ b/src/linux/setgroups.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include "syscall.h" diff --git a/src/linux/sethostname.c b/src/linux/sethostname.c index 79a8707..9313b32 100644 --- a/src/linux/sethostname.c +++ b/src/linux/sethostname.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include "syscall.h" diff --git a/src/linux/setns.c b/src/linux/setns.c index 7029b74..0afec81 100644 --- a/src/linux/setns.c +++ b/src/linux/setns.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include "syscall.h" -#include "libc.h" int setns(int fd, int nstype) { diff --git a/src/linux/stime.c b/src/linux/stime.c index 6a7e9e8..29a1ec6 100644 --- a/src/linux/stime.c +++ b/src/linux/stime.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE +#include #include int stime(time_t *t) diff --git a/src/linux/sysinfo.c b/src/linux/sysinfo.c index 2dbd0ad..7e64f33 100644 --- a/src/linux/sysinfo.c +++ b/src/linux/sysinfo.c @@ -1,7 +1,6 @@ +#include #include "syscall.h" -struct sysinfo; - int sysinfo(struct sysinfo *info) { return syscall(SYS_sysinfo, info); diff --git a/src/linux/wait4.c b/src/linux/wait4.c index b3ae75e..97f12cc 100644 --- a/src/linux/wait4.c +++ b/src/linux/wait4.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include #include -#include #include "syscall.h" pid_t wait4(pid_t pid, int *status, int options, struct rusage *usage) -- cgit v1.1