svn commit: trunk/busybox: init libbb loginutils miscutils networki etc...

aldot at busybox.net aldot at busybox.net
Sun Jan 27 12:50:13 UTC 2008


Author: aldot
Date: 2008-01-27 04:50:12 -0800 (Sun, 27 Jan 2008)
New Revision: 20909

Log:
- fix conflicting decls of syslog related facilitynames and prioritynames tables


Modified:
   trunk/busybox/init/init.c
   trunk/busybox/libbb/info_msg.c
   trunk/busybox/libbb/verror_msg.c
   trunk/busybox/loginutils/login.c
   trunk/busybox/loginutils/passwd.c
   trunk/busybox/loginutils/sulogin.c
   trunk/busybox/miscutils/crond.c
   trunk/busybox/miscutils/devfsd.c
   trunk/busybox/networking/dnsd.c
   trunk/busybox/networking/isrv_identd.c
   trunk/busybox/networking/libiproute/iprule.c
   trunk/busybox/networking/telnetd.c
   trunk/busybox/networking/zcip.c
   trunk/busybox/sysklogd/klogd.c
   trunk/busybox/sysklogd/logger.c
   trunk/busybox/sysklogd/syslogd.c
   trunk/busybox/util-linux/mount.c


Changeset:
Modified: trunk/busybox/init/init.c
===================================================================
--- trunk/busybox/init/init.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/init/init.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -10,9 +10,9 @@
  */
 
 #include "libbb.h"
+#include <syslog.h>
 #include <paths.h>
 #include <sys/reboot.h>
-#include <sys/syslog.h>
 
 #define INIT_BUFFS_SIZE 256
 #define CONSOLE_NAME_SIZE 32

Modified: trunk/busybox/libbb/info_msg.c
===================================================================
--- trunk/busybox/libbb/info_msg.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/libbb/info_msg.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -7,8 +7,8 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
+#include "libbb.h"
 #include <syslog.h>
-#include "libbb.h"
 
 void bb_info_msg(const char *s, ...)
 {

Modified: trunk/busybox/libbb/verror_msg.c
===================================================================
--- trunk/busybox/libbb/verror_msg.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/libbb/verror_msg.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -7,8 +7,8 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
+#include "libbb.h"
 #include <syslog.h>
-#include "libbb.h"
 
 smallint logmode = LOGMODE_STDIO;
 const char *msg_eol = "\n";

Modified: trunk/busybox/loginutils/login.c
===================================================================
--- trunk/busybox/loginutils/login.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/loginutils/login.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -4,9 +4,9 @@
  */
 
 #include "libbb.h"
+#include <syslog.h>
 #include <utmp.h>
 #include <sys/resource.h>
-#include <syslog.h>
 
 #if ENABLE_SELINUX
 #include <selinux/selinux.h>  /* for is_selinux_enabled()  */

Modified: trunk/busybox/loginutils/passwd.c
===================================================================
--- trunk/busybox/loginutils/passwd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/loginutils/passwd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -6,7 +6,6 @@
 #include "libbb.h"
 #include <syslog.h>
 
-
 static void nuke_str(char *str)
 {
 	if (str) memset(str, 0, strlen(str));

Modified: trunk/busybox/loginutils/sulogin.c
===================================================================
--- trunk/busybox/loginutils/sulogin.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/loginutils/sulogin.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -5,10 +5,9 @@
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
 
+#include "libbb.h"
 #include <syslog.h>
 
-#include "libbb.h"
-
 //static void catchalarm(int ATTRIBUTE_UNUSED junk)
 //{
 //	exit(EXIT_FAILURE);

Modified: trunk/busybox/miscutils/crond.c
===================================================================
--- trunk/busybox/miscutils/crond.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/miscutils/crond.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -11,8 +11,8 @@
  * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
  */
 
-#include <sys/syslog.h>
 #include "libbb.h"
+#include <syslog.h>
 
 #ifndef CRONTABS
 #define CRONTABS        "/var/spool/cron/crontabs"

Modified: trunk/busybox/miscutils/devfsd.c
===================================================================
--- trunk/busybox/miscutils/devfsd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/miscutils/devfsd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -53,18 +53,13 @@
     The postal address is:
       Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
 */
+#include "libbb.h"
+#include "xregex.h"
+#include <syslog.h>
 
-//#include <sys/wait.h>
-//#include <sys/ioctl.h>
-//#include <sys/socket.h>
 #include <sys/un.h>
-#include <dirent.h>
-#include <syslog.h>
 #include <sys/sysmacros.h>
-#include "libbb.h"
-#include "xregex.h"
 
-
 /* Various defines taken from linux/major.h */
 #define IDE0_MAJOR	3
 #define IDE1_MAJOR	22

Modified: trunk/busybox/networking/dnsd.c
===================================================================
--- trunk/busybox/networking/dnsd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/networking/dnsd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -17,8 +17,8 @@
  * the first porting of oao' scdns to busybox also.
  */
 
+#include "libbb.h"
 #include <syslog.h>
-#include "libbb.h"
 
 //#define DEBUG 1
 #define DEBUG 0

Modified: trunk/busybox/networking/isrv_identd.c
===================================================================
--- trunk/busybox/networking/isrv_identd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/networking/isrv_identd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -7,8 +7,8 @@
  * Licensed under GPL version 2, see file LICENSE in this tarball for details.
  */
 
+#include "libbb.h"
 #include <syslog.h>
-#include "libbb.h"
 #include "isrv.h"
 
 enum { TIMEOUT = 20 };

Modified: trunk/busybox/networking/libiproute/iprule.c
===================================================================
--- trunk/busybox/networking/libiproute/iprule.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/networking/libiproute/iprule.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -16,7 +16,6 @@
  * initially integrated into busybox by Bernhard Fischer
  */
 
-#include <syslog.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>

Modified: trunk/busybox/networking/telnetd.c
===================================================================
--- trunk/busybox/networking/telnetd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/networking/telnetd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -24,15 +24,14 @@
 #define DEBUG 0
 
 #include "libbb.h"
+#include <syslog.h>
 
 #if DEBUG
 #define TELCMDS
 #define TELOPTS
 #endif
 #include <arpa/telnet.h>
-#include <sys/syslog.h>
 
-
 /* Structure that describes a session */
 struct tsession {
 	struct tsession *next;

Modified: trunk/busybox/networking/zcip.c
===================================================================
--- trunk/busybox/networking/zcip.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/networking/zcip.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -23,9 +23,6 @@
 // - avoid silent script failures, especially under load...
 // - link status monitoring (restart on link-up; stop on link-down)
 
-#include <syslog.h>
-#include <poll.h>
-#include <sys/wait.h>
 #include <netinet/ether.h>
 #include <net/ethernet.h>
 #include <net/if.h>
@@ -34,6 +31,7 @@
 #include <linux/sockios.h>
 
 #include "libbb.h"
+#include <syslog.h>
 
 /* We don't need more than 32 bits of the counter */
 #define MONOTONIC_US() ((unsigned)monotonic_us())

Modified: trunk/busybox/sysklogd/klogd.c
===================================================================
--- trunk/busybox/sysklogd/klogd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/sysklogd/klogd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -18,7 +18,7 @@
  */
 
 #include "libbb.h"
-#include <sys/syslog.h>
+#include <syslog.h>
 #include <sys/klog.h>
 
 static void klogd_signal(int sig ATTRIBUTE_UNUSED)

Modified: trunk/busybox/sysklogd/logger.c
===================================================================
--- trunk/busybox/sysklogd/logger.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/sysklogd/logger.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -8,28 +8,32 @@
  */
 
 #include "libbb.h"
-
-#if !defined CONFIG_SYSLOGD
-
-/* SYSLOG_NAMES defined to pull prioritynames[] and facilitynames[]
- * from syslog.h. Grrrr - glibc puts those in _rwdata_! :( */
+#ifndef CONFIG_SYSLOGD
 #define SYSLOG_NAMES
-#define SYSLOG_NAMES_CONST /* uclibc is saner :) */
-#include <sys/syslog.h>
-
+#define SYSLOG_NAMES_CONST
+#include <syslog.h>
 #else
-#include <sys/syslog.h>
-#  ifndef __dietlibc__
-	/* We have to do this since the header file defines static
-	 * structures.  Argh.... bad libc, bad, bad...
-	 */
-	typedef struct _code {
-		char *c_name;
-		int c_val;
-	} CODE;
-	extern CODE prioritynames[];
-	extern CODE facilitynames[];
+/* brokenness alert. Everybody except dietlibc get's this wrong by neither
+ * providing a typedef nor an extern for facilitynames and prioritynames
+ * in syslog.h.
+ */
+# include <syslog.h>
+# ifndef __dietlibc__
+/* We have to do this since the header file does neither provide a sane type
+ * for this structure nor extern definitions.  Argh.... bad libc, bad, bad...
+ */
+typedef struct _code {
+	char *c_name; /* FIXME: this should be const char *const c_name ! */
+	int c_val;
+} CODE;
+#  ifdef __UCLIBC__
+extern const CODE prioritynames[];
+extern const CODE facilitynames[];
+#  else
+extern CODE prioritynames[];
+extern CODE facilitynames[];
 #  endif
+# endif
 #endif
 
 /* Decode a symbolic name to a numeric value

Modified: trunk/busybox/sysklogd/syslogd.c
===================================================================
--- trunk/busybox/sysklogd/syslogd.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/sysklogd/syslogd.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -14,14 +14,12 @@
  */
 
 #include "libbb.h"
+#define SYSLOG_NAMES
+#define SYSLOG_NAMES_CONST
+#include <syslog.h>
+
 #include <paths.h>
 #include <sys/un.h>
-
-/* SYSLOG_NAMES defined to pull prioritynames[] and facilitynames[]
- * from syslog.h. Grrrr - glibc puts those in _rwdata_! :( */
-#define SYSLOG_NAMES
-#define SYSLOG_NAMES_CONST /* uclibc is saner :) */
-#include <sys/syslog.h>
 #include <sys/uio.h>
 
 #if ENABLE_FEATURE_REMOTE_LOG

Modified: trunk/busybox/util-linux/mount.c
===================================================================
--- trunk/busybox/util-linux/mount.c	2008-01-27 09:41:24 UTC (rev 20908)
+++ trunk/busybox/util-linux/mount.c	2008-01-27 12:50:12 UTC (rev 20909)
@@ -20,9 +20,9 @@
 
 #include <mntent.h>
 #include "libbb.h"
+#include <syslog.h>
 
 /* Needed for nfs support only... */
-#include <syslog.h>
 #include <sys/utsname.h>
 #undef TRUE
 #undef FALSE




More information about the busybox-cvs mailing list