Explorar el Código

* Cast pid_t to unsigned long to avoid solaris warnings

Bryan Drewery hace 16 años
padre
commit
9679b5d051
Se han modificado 3 ficheros con 5 adiciones y 5 borrados
  1. 1 1
      src/chanprog.c
  2. 2 2
      src/cmds.c
  3. 2 2
      src/debug.c

+ 1 - 1
src/chanprog.c

@@ -326,7 +326,7 @@ void tell_verbose_status(int idx)
 
   dprintf(idx, "OS: %s %s\n", uni_t, vers_t);
   dprintf(idx, "Running from: %s\n", binname);
-  dprintf(idx, "uid: %s (%d) pid: %d homedir: %s\n", conf.username, conf.uid, mypid, conf.homedir);
+  dprintf(idx, "uid: %s (%d) pid: %lu homedir: %s\n", conf.username, conf.uid, (unsigned long) mypid, conf.homedir);
   if (tempdir[0])
     dprintf(idx, "Tempdir     : %s\n", tempdir);
   if (conf.datadir)

+ 2 - 2
src/cmds.c

@@ -1784,7 +1784,7 @@ static void cmd_conf(int idx, char *par)
     for (bot = conf.bots; bot && bot->nick; bot = bot->next) {
       i++;
       if (!listbot || (listbot && !strcasecmp(listbot, bot->nick)))
-        dprintf(idx, "%d: %s%s IP: %s HOST: %s IP6: %s HOST6: %s HUB: %d PID: %d\n", i,
+        dprintf(idx, "%d: %s%s IP: %s HOST: %s IP6: %s HOST6: %s HUB: %d PID: %lu\n", i,
                       bot->disabled ? "/" : "",
                       bot->nick,
                       bot->net.ip ? bot->net.ip : "",
@@ -1792,7 +1792,7 @@ static void cmd_conf(int idx, char *par)
                       bot->net.ip6 ? bot->net.ip6 : "",
                       bot->net.host6 ? bot->net.host6 : "",
                       bot->hub,
-                      bot->pid);
+                      (unsigned long) bot->pid);
     }
   }
   if (listbot)

+ 2 - 2
src/debug.c

@@ -124,9 +124,9 @@ void sdprintf (const char *format, ...)
     if (sdebug) {
 #endif
       if (!backgrd)
-        dprintf(DP_STDOUT, "[D:%d] %s%s%s\n", mypid, BOLD(-1), s, BOLD_END(-1));
+        dprintf(DP_STDOUT, "[D:%lu] %s%s%s\n", (unsigned long) mypid, BOLD(-1), s, BOLD_END(-1));
       else
-        printf("[D:%d] %s%s%s\n", mypid, BOLD(-1), s, BOLD_END(-1));
+        printf("[D:%lu] %s%s%s\n", (unsigned long) mypid, BOLD(-1), s, BOLD_END(-1));
 #ifdef DEBUG
     }
     logfile(LOG_DEBUG, s);