summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-07-09 06:59:58 +0000
committerEric Andersen <andersen@codepoet.org>2000-07-09 06:59:58 +0000
commit999bf72f49a501e47448010c4ddb06dc03ed1612 (patch)
tree75d6c4187384bc385d59838834bac80f53a077cd
parente9b527ae48cb9609ea0668974de32da523ebd231 (diff)
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.c2
-rw-r--r--coreutils/md5sum.c8
-rw-r--r--coreutils/uudecode.c1
-rw-r--r--coreutils/uuencode.c1
-rw-r--r--insmod.c5
-rw-r--r--loadacm.c2
-rw-r--r--md5sum.c8
-rw-r--r--modutils/insmod.c5
-rw-r--r--networking/ping.c4
-rw-r--r--ping.c4
-rw-r--r--sysklogd/syslogd.c2
-rw-r--r--syslogd.c2
-rw-r--r--uudecode.c1
-rw-r--r--uuencode.c1
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)
int parse_failed = 0;
int is_unicode;
- if (fstat(fp->_fileno, &stbuf))
+ if (fstat(fileno(fp), &stbuf))
perror("Cannot stat map file"), exit(1);
/* 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 @@
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
+#include <getopt.h>
+
+/* It turns out that libc5 doesn't have this in its headers
+ * even though it is actually in the lib. Force it to work */
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
+#define getline __getline
+extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
+#endif
//----------------------------------------------------------------------------
//--------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 @@
#include <stdio.h>
#include <errno.h>
+#include <getopt.h>
#include <pwd.h>
/*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 @@
#include <stdio.h>
#include <errno.h>
+#include <getopt.h>
#include <pwd.h>
#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
diff --git a/insmod.c b/insmod.c
index 75058b959..79732b017 100644
--- a/insmod.c
+++ b/insmod.c
@@ -38,6 +38,7 @@
#include <dirent.h>
#include <ctype.h>
#include <assert.h>
+#include <getopt.h>
#include <sys/utsname.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
@@ -71,7 +72,7 @@
#ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1
-#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
+#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
@@ -277,7 +278,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1
-#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
+#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
diff --git a/loadacm.c b/loadacm.c
index cf393d92d..a64c691d2 100644
--- a/loadacm.c
+++ b/loadacm.c
@@ -68,7 +68,7 @@ int screen_map_load(int fd, FILE * fp)
int parse_failed = 0;
int is_unicode;
- if (fstat(fp->_fileno, &stbuf))
+ if (fstat(fileno(fp), &stbuf))
perror("Cannot stat map file"), exit(1);
/* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
diff --git a/md5sum.c b/md5sum.c
index ffa9e6bce..f4a8b99d0 100644
--- a/md5sum.c
+++ b/md5sum.c
@@ -24,6 +24,14 @@
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
+#include <getopt.h>
+
+/* It turns out that libc5 doesn't have this in its headers
+ * even though it is actually in the lib. Force it to work */
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
+#define getline __getline
+extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
+#endif
//----------------------------------------------------------------------------
//--------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 @@
#include <dirent.h>
#include <ctype.h>
#include <assert.h>
+#include <getopt.h>
#include <sys/utsname.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
@@ -71,7 +72,7 @@
#ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1
-#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
+#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
@@ -277,7 +278,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1
-#ident "$Id: insmod.c,v 1.12 2000/07/08 18:55:24 andersen Exp $"
+#ident "$Id: insmod.c,v 1.13 2000/07/09 06:59:58 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
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 @@
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.18 2000/07/06 23:10:29 andersen Exp $
+ * $Id: ping.c,v 1.19 2000/07/09 06:59:58 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -51,7 +51,7 @@
/* It turns out that libc5 doesn't have proper icmp support
* built into it header files, so we have to supplement it */
-#if __GNU_LIBRARY__ < 5
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
typedef unsigned int socklen_t;
#define ICMP_MINLEN 8 /* abs minimum */
diff --git a/ping.c b/ping.c
index b9e8d0fd2..c560a7ce2 100644
--- a/ping.c
+++ b/ping.c
@@ -1,6 +1,6 @@
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.18 2000/07/06 23:10:29 andersen Exp $
+ * $Id: ping.c,v 1.19 2000/07/09 06:59:58 andersen Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -51,7 +51,7 @@
/* It turns out that libc5 doesn't have proper icmp support
* built into it header files, so we have to supplement it */
-#if __GNU_LIBRARY__ < 5
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
typedef unsigned int socklen_t;
#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 @@
#include <sys/param.h>
#include <linux/unistd.h>
-#if __GNU_LIBRARY__ < 5
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
typedef unsigned int socklen_t;
diff --git a/syslogd.c b/syslogd.c
index 9ab228f21..aa1218f3f 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -42,7 +42,7 @@
#include <sys/param.h>
#include <linux/unistd.h>
-#if __GNU_LIBRARY__ < 5
+#if ! defined __GLIBC__ && ! defined __UCLIBC__
typedef unsigned int socklen_t;
diff --git a/uudecode.c b/uudecode.c
index 752497cb0..ac33762b0 100644
--- a/uudecode.c
+++ b/uudecode.c
@@ -55,6 +55,7 @@
#include <stdio.h>
#include <errno.h>
+#include <getopt.h>
#include <pwd.h>
/*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 @@
#include <stdio.h>
#include <errno.h>
+#include <getopt.h>
#include <pwd.h>
#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)