]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix Solaris warnings about pid_t to int conversion
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 30 May 2010 08:47:25 +0000 (10:47 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 30 May 2010 08:47:25 +0000 (10:47 +0200)
util.c

diff --git a/util.c b/util.c
index 2330d0a809d16cad9ac71451d50c6cd09e293287..d1c48640f52568f9339c37dd6b85287adb22bf7a 100644 (file)
--- a/util.c
+++ b/util.c
@@ -71,9 +71,10 @@ static void log_prefix(void)
        gettimeofday(&tv, NULL);
        tm = localtime(&tv.tv_sec);
        strftime(timestamp, sizeof(timestamp), "%Y-%m-%dT%H:%M:%S", tm);
-       fprintf(logfile, "[%s.%06d %-5d] ", timestamp, (int)tv.tv_usec, getpid());
+       fprintf(logfile, "[%s.%06d %-5d] ", timestamp, (int)tv.tv_usec,
+               (int)getpid());
 #else
-       fprintf(logfile, "[%-5d] ", getpid());
+       fprintf(logfile, "[%-5d] ", (int)getpid());
 #endif
 }
 
@@ -127,7 +128,8 @@ void fatal(const char *format, ...)
                        logfile = fopen(cache_logfile, "a");
                }
                if (logfile) {
-                       fprintf(logfile, "[%-5d] FATAL: %s", getpid(), msg);
+                       fprintf(logfile, "[%-5d] FATAL: %s", (int)getpid(),
+                               msg);
                        fflush(logfile);
                }
        }