From: Joel Rosdahl Date: Sun, 30 May 2010 08:47:25 +0000 (+0200) Subject: Fix Solaris warnings about pid_t to int conversion X-Git-Tag: v3.0~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c247a6c6566a0b6c001bfe7be831b53180ae6fa1;p=thirdparty%2Fccache.git Fix Solaris warnings about pid_t to int conversion --- diff --git a/util.c b/util.c index 2330d0a80..d1c48640f 100644 --- 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); } }