aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-09 23:52:18 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-09 23:52:18 +0000
commitb6b519b416189202d18d888d61d8bbe50dc30325 (patch)
treee04e4a2329b9cf5c96b31fa064e6c85dfb8b9055
parentd3f97f19718fa5890cb6cb3fd010f7b4a7bd3ae1 (diff)
downloadbusybox-w32-b6b519b416189202d18d888d61d8bbe50dc30325.tar.gz
busybox-w32-b6b519b416189202d18d888d61d8bbe50dc30325.tar.bz2
busybox-w32-b6b519b416189202d18d888d61d8bbe50dc30325.zip
Update how we detect if libc5 is in use.
-Erik
-rw-r--r--chmod_chown_chgrp.c1
-rw-r--r--dutmp.c9
-rw-r--r--include/libbb.h5
-rw-r--r--init.c14
-rw-r--r--init/init.c14
-rw-r--r--interface.c4
-rw-r--r--libbb/daemon.c4
-rw-r--r--libbb/libbb.h5
-rw-r--r--logread.c4
-rw-r--r--miscutils/dutmp.c9
-rw-r--r--miscutils/update.c8
-rw-r--r--networking/ping.c4
-rw-r--r--ping.c4
-rw-r--r--sysklogd/logread.c4
-rw-r--r--update.c8
15 files changed, 44 insertions, 53 deletions
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c
index 4fc986904..9714e1ca5 100644
--- a/chmod_chown_chgrp.c
+++ b/chmod_chown_chgrp.c
@@ -49,6 +49,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
49 switch (whichApp) { 49 switch (whichApp) {
50 case CHGRP_APP: 50 case CHGRP_APP:
51 case CHOWN_APP: 51 case CHOWN_APP:
52 /* Don't use lchown for libc5 or glibc older then 2.1.x */
52#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) 53#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
53 if (lchown 54 if (lchown
54 (fileName, (whichApp == CHOWN_APP) ? uid : statbuf->st_uid, 55 (fileName, (whichApp == CHOWN_APP) ? uid : statbuf->st_uid,
diff --git a/dutmp.c b/dutmp.c
index a75a6e392..26253b445 100644
--- a/dutmp.c
+++ b/dutmp.c
@@ -41,11 +41,9 @@ extern int dutmp_main(int argc, char **argv)
41 } 41 }
42 } 42 }
43 43
44/* Kludge around the fact that the binary format for utmp has changed, and the 44/* Kludge around the fact that the binary format for utmp has changed. */
45 * fact the stupid libc doesn't have a reliable #define to announce that libc5 45#if __GNU_LIBRARY__ < 5
46 * is being used. sigh. 46 /* Linux libc5 */
47 */
48#if ! defined __GLIBC__ || defined __UCLIBC__
49 while (read(file, (void*)&ut, sizeof(struct utmp))) { 47 while (read(file, (void*)&ut, sizeof(struct utmp))) {
50 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n", 48 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
51 ut.ut_type, ut.ut_pid, ut.ut_line, 49 ut.ut_type, ut.ut_pid, ut.ut_line,
@@ -54,6 +52,7 @@ extern int dutmp_main(int argc, char **argv)
54 (long)ut.ut_addr); 52 (long)ut.ut_addr);
55 } 53 }
56#else 54#else
55 /* Glibc, uClibc, etc */
57 while (read(file, (void*)&ut, sizeof(struct utmp))) { 56 while (read(file, (void*)&ut, sizeof(struct utmp))) {
58 printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n", 57 printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
59 ut.ut_type, ut.ut_pid, ut.ut_line, 58 ut.ut_type, ut.ut_pid, ut.ut_line,
diff --git a/include/libbb.h b/include/libbb.h
index 0001cac6f..6133b19d3 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -34,9 +34,8 @@
34#endif 34#endif
35 35
36#include <features.h> 36#include <features.h>
37/* Stupid libc doesn't have a reliable way for use to know 37
38 * that libc5 is being used. Assume this is good enough */ 38#if __GNU_LIBRARY__ < 5
39#if ! defined __GLIBC__ && ! defined __UCLIBC__
40/* libc5 doesn't define socklen_t */ 39/* libc5 doesn't define socklen_t */
41typedef unsigned int socklen_t; 40typedef unsigned int socklen_t;
42/* libc5 doesn't implement BSD 4.4 daemon() */ 41/* libc5 doesn't implement BSD 4.4 daemon() */
diff --git a/init.c b/init.c
index bf992b52c..619421891 100644
--- a/init.c
+++ b/init.c
@@ -85,13 +85,13 @@ static const int RB_ENABLE_CAD = 0x89abcdef;
85static const int RB_DISABLE_CAD = 0; 85static const int RB_DISABLE_CAD = 0;
86#define RB_POWER_OFF 0x4321fedc 86#define RB_POWER_OFF 0x4321fedc
87static const int RB_AUTOBOOT = 0x01234567; 87static const int RB_AUTOBOOT = 0x01234567;
88#if defined(__GLIBC__) || defined (__UCLIBC__) 88
89#include <sys/reboot.h> 89#if __GNU_LIBRARY__ > 5
90 #include <sys/reboot.h>
90 #define init_reboot(magic) reboot(magic) 91 #define init_reboot(magic) reboot(magic)
91#else 92#else
92 #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic) 93 #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
93#endif 94#endif
94#endif
95 95
96#ifndef _PATH_STDPATH 96#ifndef _PATH_STDPATH
97#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" 97#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
@@ -112,11 +112,11 @@ static const int RB_AUTOBOOT = 0x01234567;
112 112
113#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 113#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
114 114
115#if defined(__GLIBC__) 115#if __GNU_LIBRARY__ > 5
116#include <sys/kdaemon.h> 116 #include <sys/kdaemon.h>
117#else 117#else
118extern int bdflush (int func, long int data); 118 extern int bdflush (int func, long int data);
119#endif /* __GLIBC__ */ 119#endif
120 120
121 121
122#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ 122#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
diff --git a/init/init.c b/init/init.c
index bf992b52c..619421891 100644
--- a/init/init.c
+++ b/init/init.c
@@ -85,13 +85,13 @@ static const int RB_ENABLE_CAD = 0x89abcdef;
85static const int RB_DISABLE_CAD = 0; 85static const int RB_DISABLE_CAD = 0;
86#define RB_POWER_OFF 0x4321fedc 86#define RB_POWER_OFF 0x4321fedc
87static const int RB_AUTOBOOT = 0x01234567; 87static const int RB_AUTOBOOT = 0x01234567;
88#if defined(__GLIBC__) || defined (__UCLIBC__) 88
89#include <sys/reboot.h> 89#if __GNU_LIBRARY__ > 5
90 #include <sys/reboot.h>
90 #define init_reboot(magic) reboot(magic) 91 #define init_reboot(magic) reboot(magic)
91#else 92#else
92 #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic) 93 #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic)
93#endif 94#endif
94#endif
95 95
96#ifndef _PATH_STDPATH 96#ifndef _PATH_STDPATH
97#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" 97#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
@@ -112,11 +112,11 @@ static const int RB_AUTOBOOT = 0x01234567;
112 112
113#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 113#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
114 114
115#if defined(__GLIBC__) 115#if __GNU_LIBRARY__ > 5
116#include <sys/kdaemon.h> 116 #include <sys/kdaemon.h>
117#else 117#else
118extern int bdflush (int func, long int data); 118 extern int bdflush (int func, long int data);
119#endif /* __GLIBC__ */ 119#endif
120 120
121 121
122#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ 122#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
diff --git a/interface.c b/interface.c
index a80cd5524..a043d7223 100644
--- a/interface.c
+++ b/interface.c
@@ -3,7 +3,7 @@
3 * that either displays or sets the characteristics of 3 * that either displays or sets the characteristics of
4 * one or more of the system's networking interfaces. 4 * one or more of the system's networking interfaces.
5 * 5 *
6 * Version: $Id: interface.c,v 1.5 2001/03/15 15:37:48 mjn3 Exp $ 6 * Version: $Id: interface.c,v 1.6 2001/04/09 23:52:18 andersen Exp $
7 * 7 *
8 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 8 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
9 * and others. Copyright 1993 MicroWalt Corporation 9 * and others. Copyright 1993 MicroWalt Corporation
@@ -115,7 +115,7 @@ struct in6_ifreq {
115#endif /* HAVE_AFINET6 */ 115#endif /* HAVE_AFINET6 */
116 116
117#if HAVE_AFIPX 117#if HAVE_AFIPX
118#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) 118#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
119#include <netipx/ipx.h> 119#include <netipx/ipx.h>
120#else 120#else
121#include "ipx.h" 121#include "ipx.h"
diff --git a/libbb/daemon.c b/libbb/daemon.c
index 55a776ce0..6d4169ed5 100644
--- a/libbb/daemon.c
+++ b/libbb/daemon.c
@@ -32,9 +32,7 @@
32#include <unistd.h> 32#include <unistd.h>
33 33
34 34
35/* Stupid libc doesn't have a reliable way for use to know 35#if __GNU_LIBRARY__ < 5
36 * that libc5 is being used. Assume this is good enough */
37#if ! defined __GLIBC__ && ! defined __UCLIBC__
38 36
39int daemon( int nochdir, int noclose ) 37int daemon( int nochdir, int noclose )
40{ 38{
diff --git a/libbb/libbb.h b/libbb/libbb.h
index 0001cac6f..6133b19d3 100644
--- a/libbb/libbb.h
+++ b/libbb/libbb.h
@@ -34,9 +34,8 @@
34#endif 34#endif
35 35
36#include <features.h> 36#include <features.h>
37/* Stupid libc doesn't have a reliable way for use to know 37
38 * that libc5 is being used. Assume this is good enough */ 38#if __GNU_LIBRARY__ < 5
39#if ! defined __GLIBC__ && ! defined __UCLIBC__
40/* libc5 doesn't define socklen_t */ 39/* libc5 doesn't define socklen_t */
41typedef unsigned int socklen_t; 40typedef unsigned int socklen_t;
42/* libc5 doesn't implement BSD 4.4 daemon() */ 41/* libc5 doesn't implement BSD 4.4 daemon() */
diff --git a/logread.c b/logread.c
index 19e8aefa6..d3349625c 100644
--- a/logread.c
+++ b/logread.c
@@ -35,9 +35,7 @@
35#include <setjmp.h> 35#include <setjmp.h>
36#include "busybox.h" 36#include "busybox.h"
37 37
38/* Stupid libc doesn't have a reliable way for use to know 38#if __GNU_LIBRARY__ < 5
39 * that libc5 is being used. Assume this is good enough */
40#if ! defined __GLIBC__ && ! defined __UCLIBC__
41#error Sorry. Looks like you are using libc5. 39#error Sorry. Looks like you are using libc5.
42#error libc5 shm support isnt good enough. 40#error libc5 shm support isnt good enough.
43#error Please disable BB_FEATURE_IPC_SYSLOG 41#error Please disable BB_FEATURE_IPC_SYSLOG
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index a75a6e392..26253b445 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/dutmp.c
@@ -41,11 +41,9 @@ extern int dutmp_main(int argc, char **argv)
41 } 41 }
42 } 42 }
43 43
44/* Kludge around the fact that the binary format for utmp has changed, and the 44/* Kludge around the fact that the binary format for utmp has changed. */
45 * fact the stupid libc doesn't have a reliable #define to announce that libc5 45#if __GNU_LIBRARY__ < 5
46 * is being used. sigh. 46 /* Linux libc5 */
47 */
48#if ! defined __GLIBC__ || defined __UCLIBC__
49 while (read(file, (void*)&ut, sizeof(struct utmp))) { 47 while (read(file, (void*)&ut, sizeof(struct utmp))) {
50 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n", 48 printf("%d|%d|%s|%s|%s|%s|%s|%lx\n",
51 ut.ut_type, ut.ut_pid, ut.ut_line, 49 ut.ut_type, ut.ut_pid, ut.ut_line,
@@ -54,6 +52,7 @@ extern int dutmp_main(int argc, char **argv)
54 (long)ut.ut_addr); 52 (long)ut.ut_addr);
55 } 53 }
56#else 54#else
55 /* Glibc, uClibc, etc */
57 while (read(file, (void*)&ut, sizeof(struct utmp))) { 56 while (read(file, (void*)&ut, sizeof(struct utmp))) {
58 printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n", 57 printf("%d|%d|%s|%s|%s|%s|%d|%d|%ld|%ld|%ld|%x\n",
59 ut.ut_type, ut.ut_pid, ut.ut_line, 58 ut.ut_type, ut.ut_pid, ut.ut_line,
diff --git a/miscutils/update.c b/miscutils/update.c
index ce2b6cf08..a6550b05c 100644
--- a/miscutils/update.c
+++ b/miscutils/update.c
@@ -33,11 +33,11 @@
33#include <unistd.h> /* for getopt() */ 33#include <unistd.h> /* for getopt() */
34#include <stdlib.h> 34#include <stdlib.h>
35 35
36#if defined(__GLIBC__) 36#if __GNU_LIBRARY__ > 5
37#include <sys/kdaemon.h> 37 #include <sys/kdaemon.h>
38#else 38#else
39extern int bdflush (int func, long int data); 39 extern int bdflush (int func, long int data);
40#endif /* __GLIBC__ */ 40#endif
41 41
42#include "busybox.h" 42#include "busybox.h"
43 43
diff --git a/networking/ping.c b/networking/ping.c
index 8ac963076..8b82dcaac 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.39 2001/03/14 01:23:07 andersen Exp $ 3 * $Id: ping.c,v 1.40 2001/04/09 23:52:18 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>
@@ -54,7 +54,7 @@
54 54
55/* It turns out that libc5 doesn't have proper icmp support 55/* It turns out that libc5 doesn't have proper icmp support
56 * built into it header files, so we have to supplement it */ 56 * built into it header files, so we have to supplement it */
57#if ! defined __GLIBC__ && ! defined __UCLIBC__ 57#if __GNU_LIBRARY__ < 5
58static const int ICMP_MINLEN = 8; /* abs minimum */ 58static const int ICMP_MINLEN = 8; /* abs minimum */
59 59
60struct icmp_ra_addr 60struct icmp_ra_addr
diff --git a/ping.c b/ping.c
index 8ac963076..8b82dcaac 100644
--- a/ping.c
+++ b/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.39 2001/03/14 01:23:07 andersen Exp $ 3 * $Id: ping.c,v 1.40 2001/04/09 23:52:18 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>
@@ -54,7 +54,7 @@
54 54
55/* It turns out that libc5 doesn't have proper icmp support 55/* It turns out that libc5 doesn't have proper icmp support
56 * built into it header files, so we have to supplement it */ 56 * built into it header files, so we have to supplement it */
57#if ! defined __GLIBC__ && ! defined __UCLIBC__ 57#if __GNU_LIBRARY__ < 5
58static const int ICMP_MINLEN = 8; /* abs minimum */ 58static const int ICMP_MINLEN = 8; /* abs minimum */
59 59
60struct icmp_ra_addr 60struct icmp_ra_addr
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index 19e8aefa6..d3349625c 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -35,9 +35,7 @@
35#include <setjmp.h> 35#include <setjmp.h>
36#include "busybox.h" 36#include "busybox.h"
37 37
38/* Stupid libc doesn't have a reliable way for use to know 38#if __GNU_LIBRARY__ < 5
39 * that libc5 is being used. Assume this is good enough */
40#if ! defined __GLIBC__ && ! defined __UCLIBC__
41#error Sorry. Looks like you are using libc5. 39#error Sorry. Looks like you are using libc5.
42#error libc5 shm support isnt good enough. 40#error libc5 shm support isnt good enough.
43#error Please disable BB_FEATURE_IPC_SYSLOG 41#error Please disable BB_FEATURE_IPC_SYSLOG
diff --git a/update.c b/update.c
index ce2b6cf08..a6550b05c 100644
--- a/update.c
+++ b/update.c
@@ -33,11 +33,11 @@
33#include <unistd.h> /* for getopt() */ 33#include <unistd.h> /* for getopt() */
34#include <stdlib.h> 34#include <stdlib.h>
35 35
36#if defined(__GLIBC__) 36#if __GNU_LIBRARY__ > 5
37#include <sys/kdaemon.h> 37 #include <sys/kdaemon.h>
38#else 38#else
39extern int bdflush (int func, long int data); 39 extern int bdflush (int func, long int data);
40#endif /* __GLIBC__ */ 40#endif
41 41
42#include "busybox.h" 42#include "busybox.h"
43 43