diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-09 06:59:58 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-09 06:59:58 +0000 |
commit | 999bf72f49a501e47448010c4ddb06dc03ed1612 (patch) | |
tree | 75d6c4187384bc385d59838834bac80f53a077cd | |
parent | e9b527ae48cb9609ea0668974de32da523ebd231 (diff) | |
download | busybox-w32-999bf72f49a501e47448010c4ddb06dc03ed1612.tar.gz busybox-w32-999bf72f49a501e47448010c4ddb06dc03ed1612.tar.bz2 busybox-w32-999bf72f49a501e47448010c4ddb06dc03ed1612.zip |
More portability updates. Now compiles cleanly vs glibc, libc5, and uclibc
(except for mkfs_minix and fsck_minix -- and it doesn't yet link vs uclibc due
to missing stuff in the library).
-Erik
-rw-r--r-- | console-tools/loadacm.c | 2 | ||||
-rw-r--r-- | coreutils/md5sum.c | 8 | ||||
-rw-r--r-- | coreutils/uudecode.c | 1 | ||||
-rw-r--r-- | coreutils/uuencode.c | 1 | ||||
-rw-r--r-- | insmod.c | 5 | ||||
-rw-r--r-- | loadacm.c | 2 | ||||
-rw-r--r-- | md5sum.c | 8 | ||||
-rw-r--r-- | modutils/insmod.c | 5 | ||||
-rw-r--r-- | networking/ping.c | 4 | ||||
-rw-r--r-- | ping.c | 4 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 2 | ||||
-rw-r--r-- | syslogd.c | 2 | ||||
-rw-r--r-- | uudecode.c | 1 | ||||
-rw-r--r-- | uuencode.c | 1 |
14 files changed, 34 insertions, 12 deletions
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c index cf393d92d..a64c691d2 100644 --- a/console-tools/loadacm.c +++ b/console-tools/loadacm.c | |||
@@ -68,7 +68,7 @@ int screen_map_load(int fd, FILE * fp) | |||
68 | int parse_failed = 0; | 68 | int parse_failed = 0; |
69 | int is_unicode; | 69 | int is_unicode; |
70 | 70 | ||
71 | if (fstat(fp->_fileno, &stbuf)) | 71 | if (fstat(fileno(fp), &stbuf)) |
72 | perror("Cannot stat map file"), exit(1); | 72 | perror("Cannot stat map file"), exit(1); |
73 | 73 | ||
74 | /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */ | 74 | /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */ |
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c index ffa9e6bce..f4a8b99d0 100644 --- a/coreutils/md5sum.c +++ b/coreutils/md5sum.c | |||
@@ -24,6 +24,14 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | #include <ctype.h> | 26 | #include <ctype.h> |
27 | #include <getopt.h> | ||
28 | |||
29 | /* It turns out that libc5 doesn't have this in its headers | ||
30 | * even though it is actually in the lib. Force it to work */ | ||
31 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ | ||
32 | #define getline __getline | ||
33 | extern _IO_ssize_t getline __P ((char **, size_t *, FILE *)); | ||
34 | #endif | ||
27 | 35 | ||
28 | //---------------------------------------------------------------------------- | 36 | //---------------------------------------------------------------------------- |
29 | //--------md5.c | 37 | //--------md5.c |
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 752497cb0..ac33762b0 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -55,6 +55,7 @@ | |||
55 | 55 | ||
56 | #include <stdio.h> | 56 | #include <stdio.h> |
57 | #include <errno.h> | 57 | #include <errno.h> |
58 | #include <getopt.h> | ||
58 | #include <pwd.h> | 59 | #include <pwd.h> |
59 | 60 | ||
60 | /*struct passwd *getpwnam();*/ | 61 | /*struct passwd *getpwnam();*/ |
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 97801aa09..e4fc1a0bc 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c | |||
@@ -56,6 +56,7 @@ | |||
56 | 56 | ||
57 | #include <stdio.h> | 57 | #include <stdio.h> |
58 | #include <errno.h> | 58 | #include <errno.h> |
59 | #include <getopt.h> | ||
59 | #include <pwd.h> | 60 | #include <pwd.h> |
60 | 61 | ||
61 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) | 62 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
@@ -38,6 +38,7 @@ | |||
38 | #include <dirent.h> | 38 | #include <dirent.h> |
39 | #include <ctype.h> | 39 | #include <ctype.h> |
40 | #include <assert.h> | 40 | #include <assert.h> |
41 | #include <getopt.h> | ||
41 | #include <sys/utsname.h> | 42 | #include <sys/utsname.h> |
42 | #include <sys/syscall.h> | 43 | #include <sys/syscall.h> |
43 | #include <linux/unistd.h> | 44 | #include <linux/unistd.h> |
@@ -71,7 +72,7 @@ | |||
71 | #ifndef MODUTILS_MODULE_H | 72 | #ifndef MODUTILS_MODULE_H |
72 | #define MODUTILS_MODULE_H 1 | 73 | #define MODUTILS_MODULE_H 1 |
73 | 74 | ||
74 | #ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $" | 75 | #ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $" |
75 | 76 | ||
76 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 77 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
77 | We do not use the kernel headers directly because we do not wish | 78 | We do not use the kernel headers directly because we do not wish |
@@ -277,7 +278,7 @@ int delete_module(const char *); | |||
277 | #ifndef MODUTILS_OBJ_H | 278 | #ifndef MODUTILS_OBJ_H |
278 | #define MODUTILS_OBJ_H 1 | 279 | #define MODUTILS_OBJ_H 1 |
279 | 280 | ||
280 | #ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $" | 281 | #ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $" |
281 | 282 | ||
282 | /* The relocatable object is manipulated using elfin types. */ | 283 | /* The relocatable object is manipulated using elfin types. */ |
283 | 284 | ||
@@ -68,7 +68,7 @@ int screen_map_load(int fd, FILE * fp) | |||
68 | int parse_failed = 0; | 68 | int parse_failed = 0; |
69 | int is_unicode; | 69 | int is_unicode; |
70 | 70 | ||
71 | if (fstat(fp->_fileno, &stbuf)) | 71 | if (fstat(fileno(fp), &stbuf)) |
72 | perror("Cannot stat map file"), exit(1); | 72 | perror("Cannot stat map file"), exit(1); |
73 | 73 | ||
74 | /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */ | 74 | /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */ |
@@ -24,6 +24,14 @@ | |||
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <errno.h> | 25 | #include <errno.h> |
26 | #include <ctype.h> | 26 | #include <ctype.h> |
27 | #include <getopt.h> | ||
28 | |||
29 | /* It turns out that libc5 doesn't have this in its headers | ||
30 | * even though it is actually in the lib. Force it to work */ | ||
31 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ | ||
32 | #define getline __getline | ||
33 | extern _IO_ssize_t getline __P ((char **, size_t *, FILE *)); | ||
34 | #endif | ||
27 | 35 | ||
28 | //---------------------------------------------------------------------------- | 36 | //---------------------------------------------------------------------------- |
29 | //--------md5.c | 37 | //--------md5.c |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 75058b959..79732b017 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <dirent.h> | 38 | #include <dirent.h> |
39 | #include <ctype.h> | 39 | #include <ctype.h> |
40 | #include <assert.h> | 40 | #include <assert.h> |
41 | #include <getopt.h> | ||
41 | #include <sys/utsname.h> | 42 | #include <sys/utsname.h> |
42 | #include <sys/syscall.h> | 43 | #include <sys/syscall.h> |
43 | #include <linux/unistd.h> | 44 | #include <linux/unistd.h> |
@@ -71,7 +72,7 @@ | |||
71 | #ifndef MODUTILS_MODULE_H | 72 | #ifndef MODUTILS_MODULE_H |
72 | #define MODUTILS_MODULE_H 1 | 73 | #define MODUTILS_MODULE_H 1 |
73 | 74 | ||
74 | #ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $" | 75 | #ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $" |
75 | 76 | ||
76 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 77 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
77 | We do not use the kernel headers directly because we do not wish | 78 | We do not use the kernel headers directly because we do not wish |
@@ -277,7 +278,7 @@ int delete_module(const char *); | |||
277 | #ifndef MODUTILS_OBJ_H | 278 | #ifndef MODUTILS_OBJ_H |
278 | #define MODUTILS_OBJ_H 1 | 279 | #define MODUTILS_OBJ_H 1 |
279 | 280 | ||
280 | #ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $" | 281 | #ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $" |
281 | 282 | ||
282 | /* The relocatable object is manipulated using elfin types. */ | 283 | /* The relocatable object is manipulated using elfin types. */ |
283 | 284 | ||
diff --git a/networking/ping.c b/networking/ping.c index b9e8d0fd2..c560a7ce2 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.18 2000/07/06 23:10:29 andersen Exp $ | 3 | * $Id: ping.c,v 1.19 2000/07/09 06:59:58 andersen Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -51,7 +51,7 @@ | |||
51 | 51 | ||
52 | /* It turns out that libc5 doesn't have proper icmp support | 52 | /* It turns out that libc5 doesn't have proper icmp support |
53 | * built into it header files, so we have to supplement it */ | 53 | * built into it header files, so we have to supplement it */ |
54 | #if __GNU_LIBRARY__ < 5 | 54 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
55 | typedef unsigned int socklen_t; | 55 | typedef unsigned int socklen_t; |
56 | 56 | ||
57 | #define ICMP_MINLEN 8 /* abs minimum */ | 57 | #define ICMP_MINLEN 8 /* abs minimum */ |
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.18 2000/07/06 23:10:29 andersen Exp $ | 3 | * $Id: ping.c,v 1.19 2000/07/09 06:59:58 andersen Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -51,7 +51,7 @@ | |||
51 | 51 | ||
52 | /* It turns out that libc5 doesn't have proper icmp support | 52 | /* It turns out that libc5 doesn't have proper icmp support |
53 | * built into it header files, so we have to supplement it */ | 53 | * built into it header files, so we have to supplement it */ |
54 | #if __GNU_LIBRARY__ < 5 | 54 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
55 | typedef unsigned int socklen_t; | 55 | typedef unsigned int socklen_t; |
56 | 56 | ||
57 | #define ICMP_MINLEN 8 /* abs minimum */ | 57 | #define ICMP_MINLEN 8 /* abs minimum */ |
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 9ab228f21..aa1218f3f 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -42,7 +42,7 @@ | |||
42 | #include <sys/param.h> | 42 | #include <sys/param.h> |
43 | #include <linux/unistd.h> | 43 | #include <linux/unistd.h> |
44 | 44 | ||
45 | #if __GNU_LIBRARY__ < 5 | 45 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
46 | 46 | ||
47 | typedef unsigned int socklen_t; | 47 | typedef unsigned int socklen_t; |
48 | 48 | ||
@@ -42,7 +42,7 @@ | |||
42 | #include <sys/param.h> | 42 | #include <sys/param.h> |
43 | #include <linux/unistd.h> | 43 | #include <linux/unistd.h> |
44 | 44 | ||
45 | #if __GNU_LIBRARY__ < 5 | 45 | #if ! defined __GLIBC__ && ! defined __UCLIBC__ |
46 | 46 | ||
47 | typedef unsigned int socklen_t; | 47 | typedef unsigned int socklen_t; |
48 | 48 | ||
diff --git a/uudecode.c b/uudecode.c index 752497cb0..ac33762b0 100644 --- a/uudecode.c +++ b/uudecode.c | |||
@@ -55,6 +55,7 @@ | |||
55 | 55 | ||
56 | #include <stdio.h> | 56 | #include <stdio.h> |
57 | #include <errno.h> | 57 | #include <errno.h> |
58 | #include <getopt.h> | ||
58 | #include <pwd.h> | 59 | #include <pwd.h> |
59 | 60 | ||
60 | /*struct passwd *getpwnam();*/ | 61 | /*struct passwd *getpwnam();*/ |
diff --git a/uuencode.c b/uuencode.c index 97801aa09..e4fc1a0bc 100644 --- a/uuencode.c +++ b/uuencode.c | |||
@@ -56,6 +56,7 @@ | |||
56 | 56 | ||
57 | #include <stdio.h> | 57 | #include <stdio.h> |
58 | #include <errno.h> | 58 | #include <errno.h> |
59 | #include <getopt.h> | ||
59 | #include <pwd.h> | 60 | #include <pwd.h> |
60 | 61 | ||
61 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) | 62 | #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |