]> git.tue.mpg.de Git - paraslash.git/commitdiff
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 379cc4d90044659fa893b22781b4f685f8534bac..15fb7ab038e8f527f0ca1b7b5a9ccfd86aea1a84 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 931124e65fe6a9224851c24c5b33f6e8d5dd6435..5d4cf6995f7645ef6bc4bb846dc3b1c7284fd4fd 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 debf9d11be254ed6cf07d7dc390763cbc0f5fb8d..2cab393700dfbf84a8119228f49a21e705174278 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 80cc8f46e36a6e70be2ed13da7bfcce6f5d5a27d..d48a0c91e391e7238c551602dacc56a0f378899b 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 55499796e8ccd8ff73751182a796cd4006b63508..3d1883f5f4b65f0c01b7b8944c6afbdb0d5f717c 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;
 }