diff options
author | Wayne Davison <wayned@samba.org> | 2011-10-08 09:15:36 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2011-10-08 09:15:36 -0700 |
commit | 3527677043f5a995b6a49e318d0f029ac187a97e (patch) | |
tree | 656f9c30b833525d2903cd094d2e7f29571bf674 /log.c | |
parent | fd91c3b6661dbd7453a143cad81ca08cd34b243b (diff) | |
download | android_external_rsync-3527677043f5a995b6a49e318d0f029ac187a97e.tar.gz android_external_rsync-3527677043f5a995b6a49e318d0f029ac187a97e.tar.bz2 android_external_rsync-3527677043f5a995b6a49e318d0f029ac187a97e.zip |
Let's cast getpid() to an int instead of a long for snprintf().
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -123,8 +123,7 @@ static void logit(int priority, const char *buf) if (logfile_was_closed) logfile_reopen(); if (logfile_fp) { - fprintf(logfile_fp, "%s [%d] %s", - timestring(time(NULL)), (int)getpid(), buf); + fprintf(logfile_fp, "%s [%d] %s", timestring(time(NULL)), (int)getpid(), buf); fflush(logfile_fp); } else { syslog(priority, "%s", buf); @@ -569,9 +568,8 @@ static void log_formatted(enum logcode code, const char *format, const char *op, } break; case 'p': - strlcat(fmt, "ld", sizeof fmt); - snprintf(buf2, sizeof buf2, fmt, - (long)getpid()); + strlcat(fmt, "d", sizeof fmt); + snprintf(buf2, sizeof buf2, fmt, (int)getpid()); n = buf2; break; case 'M': |