[BusyBox] [PATCH] Tried to remove few compiler errors for Solaris

mathuria mathuria at aludra.usc.edu
Thu Jan 30 17:40:04 UTC 2003


Hi all,

This is the first time I am submitting a patch. So please excuse me if
there are any discrepancies. I have attempted to get rid of 3 compile
errors on Solaris. Yes I know that most people dont use Busybox on
Solaris, but portability is always good.

1. File:busybox/include/libbb.h
Since socklen_t is already defined in /usr/include/sys/socket.h file,
using #ifndef _SOCKLEN_T around it removes the "warning : redifinition of
socklen_t".
2.File :busybox/include/busybox.h
Similarly, putting the definition of NBBY within #ifndef removes the
"warning : NBBY redefined".
3. File busybox/fileutils/chownc
Parse error before  __uid_t and __gid_t was removed by changing them to
uid_t and gid_t which are defined in unistd.h

Hope this helps. Happy coding.

Thanks,
Mihir
-------------- next part --------------
--- libbb.h	2003-01-30 15:49:13.024905000 -0800
+++ libbb1.h	2003-01-30 15:47:32.450762000 -0800
@@ -55,7 +55,10 @@
 
 #if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
 /* libc5 doesn't define socklen_t */
+#ifndef _SOCKLEN_T
+#define _SOCKLEN_T
 typedef unsigned int socklen_t;
+#endif
 /* libc5 doesn't implement BSD 4.4 daemon() */
 extern int daemon (int nochdir, int noclose);
 /* libc5 doesn't implement strtok_r */
--- busybox.h	2003-01-30 15:48:50.096232000 -0800
+++ busybox1.h	2003-01-30 15:47:41.670222000 -0800
@@ -95,7 +95,9 @@
 
 /* Bit map related macros -- libc5 doens't provide these... sigh.  */
 #ifndef setbit
+#ifndef NBBY
 #define NBBY            CHAR_BIT
+#endif
 #define setbit(a,i)     ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
 #define clrbit(a,i)     ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
 #define isset(a,i)      ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
--- chown.c	2003-01-30 14:42:01.351684000 -0800
+++ chown1.c	2003-01-30 14:43:24.957500000 -0800
@@ -34,7 +34,7 @@
 
 static long uid;
 static long gid;
-static int (*chown_func)(const char *, __uid_t, __gid_t) = chown;
+static int (*chown_func)(const char *, uid_t, gid_t) = chown;
 static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
 {
 	if (chown_func(fileName, uid, (gid == -1) ? statbuf->st_gid : gid) == 0) {


More information about the busybox mailing list