aboutsummaryrefslogtreecommitdiffstats
path: root/log.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2011-10-08 09:15:36 -0700
committerWayne Davison <wayned@samba.org>2011-10-08 09:15:36 -0700
commit3527677043f5a995b6a49e318d0f029ac187a97e (patch)
tree656f9c30b833525d2903cd094d2e7f29571bf674 /log.c
parentfd91c3b6661dbd7453a143cad81ca08cd34b243b (diff)
downloadandroid_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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/log.c b/log.c
index f842e552..ab858779 100644
--- a/log.c
+++ b/log.c
@@ -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':