bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdomap name conflict with 'daemon'


From: Alexander Malmberg
Subject: gdomap name conflict with 'daemon'
Date: Tue, 26 Feb 2002 02:04:24 +0100

Hi,

In the latest cvs version gdomap is defining a global variable called
'daemon'. Unfortunately, this conflicts with a function daemon() defined
in unistd.h on some systems (eg. mine, and others in irc had the same
problem). Even if this is an error in our headers, I think it'd be good
to rename the variable. Thus, I've attached a patch that renames it to
'run_as_daemon'.

- Alexander Malmberg
Index: gdomap.c
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Tools/gdomap.c,v
retrieving revision 1.46
diff -u -r1.46 gdomap.c
--- gdomap.c    25 Feb 2002 20:44:41 -0000      1.46
+++ gdomap.c    26 Feb 2002 00:56:53 -0000
@@ -126,7 +126,7 @@
 #define        MAX_EXTRA       ((GDO_NAME_MAX_LEN - 2 * IASIZE)/IASIZE)
 
 typedef        unsigned char   *uptr;
-int    daemon = 0;             /* Currently running as daemon.         */
+int    run_as_daemon = 0;      /* Currently running as daemon.         */
 int    debug = 0;              /* Extra debug logging.                 */
 int    nobcst = 0;             /* turn off broadcast probing.          */
 int    nofork = 0;             /* turn off fork() for debugging.       */
@@ -280,7 +280,7 @@
 void
 log (int prio)
 {
-  if (daemon)
+  if (run_as_daemon)
     {
       syslog (log_priority | prio, ebuf);
     }
@@ -297,7 +297,7 @@
 
   if (prio == LOG_CRIT)
     {
-      if (daemon)
+      if (run_as_daemon)
        {
          syslog (LOG_CRIT, "exiting.");
        }
@@ -4429,7 +4429,7 @@
 #ifndef __MINGW__ /* On Win32, we don't fork */
   if (nofork == 0)
     {
-      daemon = 1;
+      run_as_daemon = 1;
       /*
        *       Now fork off child process to run in background.
        */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]