Fix some gcc warnings on Solaris:
authorAndre Noll <maan@systemlinux.org>
Tue, 4 Dec 2007 13:11:10 +0000 (14:11 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 4 Dec 2007 13:11:10 +0000 (14:11 +0100)
warning: int format, pid_t arg
warning: int format, long int arg
int format, uid_t arg
int format, gid_t arg

command.c
daemon.c
ipc.c
server.c
signal.c

index 379cc4d..15fb7ab 100644 (file)
--- a/command.c
+++ b/command.c
@@ -278,7 +278,7 @@ int com_si(int fd, int argc, __a_unused char * const * argv)
                "supported senders: %s\n"
                "%s",
                ut, mmd->num_played,
-               getppid(),
+               (int)getppid(),
                mmd->active_connections,
                mmd->num_commands,
                mmd->num_connects,
index 931124e..5d4cf69 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -62,7 +62,7 @@ FILE *open_log(const char *logfile_name)
                return NULL;
        if (!(logfile = fopen(logfile_name, "a"))) {
                PARA_EMERG_LOG("can not open %s, uid: %d\n", logfile_name,
-                       getuid());
+                       (int)getuid());
                exit(EXIT_FAILURE);
        }
        setlinebuf(logfile);
@@ -123,7 +123,7 @@ void para_drop_privileges(const char *username, const char *groupname)
                }
                if (setgid(g->gr_gid) < 0) {
                        PARA_EMERG_LOG("failed to set group id %d (%s)\n",
-                               g->gr_gid, strerror(errno));
+                               (int)g->gr_gid, strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
@@ -140,7 +140,7 @@ void para_drop_privileges(const char *username, const char *groupname)
        }
        PARA_INFO_LOG("%s", "dropping root privileges\n");
        setuid(p->pw_uid);
-       PARA_DEBUG_LOG("uid: %d, euid: %d\n", getuid(), geteuid());
+       PARA_DEBUG_LOG("uid: %d, euid: %d\n", (int)getuid(), (int)geteuid());
 }
 
 /**
diff --git a/ipc.c b/ipc.c
index debf9d1..2cab393 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -52,7 +52,8 @@ static void para_semop(int id, struct sembuf *sops, int num)
                PARA_NOTICE_LOG("semaphore set %d was removed\n", id);
                return;
        }
-       PARA_EMERG_LOG("fatal semop error %s: pid %d\n", strerror(errno), getpid());
+       PARA_EMERG_LOG("fatal semop error %s: pid %d\n", strerror(errno),
+               (int)getpid());
        exit(EXIT_FAILURE);
 }
 
index 80cc8f4..d48a0c9 100644 (file)
--- a/server.c
+++ b/server.c
@@ -166,7 +166,7 @@ void para_log(int ll, const char* fmt,...)
                fprintf(outfd, "%i: ", ll);
        mypid = getpid();
        if (conf.loglevel_arg <= INFO)
-               fprintf(outfd, "(%d) ", mypid);
+               fprintf(outfd, "(%d) ", (int)mypid);
        va_start(argp, fmt);
        vfprintf(outfd, fmt, argp);
        va_end(argp);
index 5549979..3d1883f 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -85,13 +85,13 @@ int para_reap_child(pid_t *pid)
        if (*pid < 0)
                return -ERRNO_TO_PARA_ERROR(errno);
        if (WIFEXITED(status))
-               PARA_DEBUG_LOG("child %i exited. Exit status: %i\n", *pid,
+               PARA_DEBUG_LOG("child %i exited. Exit status: %i\n", (int)*pid,
                        WEXITSTATUS(status));
        else if (WIFSIGNALED(status))
-               PARA_DEBUG_LOG("child %i was killed by signal %i\n", *pid,
+               PARA_DEBUG_LOG("child %i was killed by signal %i\n", (int)*pid,
                        WTERMSIG(status));
        else
-               PARA_WARNING_LOG("child %i terminated abormally\n", *pid);
+               PARA_WARNING_LOG("child %i terminated abormally\n", (int)*pid);
        return 1;
 }