1
From c2e7a9faf12fb0c2c6dbf2f1cfad54d63a05ace6 Mon Sep 17 00:00:00 2001
2
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
3
Date: Sat, 29 Mar 2014 15:52:55 +0100
4
Subject: Add an additional \n after the number in the pidfile
6
start-stop-daemon works without the \n in the file but pkill does not.
7
Also the output of cat $PifFile looks better :)
9
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
11
clamav-milter/clamav-milter.c | 2 +-
12
clamd/server-th.c | 2 +-
13
freshclam/freshclam.c | 2 +-
14
3 files changed, 3 insertions(+), 3 deletions(-)
16
diff --git a/clamav-milter/clamav-milter.c b/clamav-milter/clamav-milter.c
17
index c622a15..710a1ee 100644
18
--- a/clamav-milter/clamav-milter.c
19
+++ b/clamav-milter/clamav-milter.c
20
@@ -383,7 +383,7 @@ int main(int argc, char **argv) {
21
if((fd = fopen(opt->strarg, "w")) == NULL) {
22
logg("!Can't save PID in file %s\n", opt->strarg);
24
- if (fprintf(fd, "%u", (unsigned int)getpid())<0) {
25
+ if (fprintf(fd, "%u\n", (unsigned int)getpid())<0) {
26
logg("!Can't save PID in file %s\n", opt->strarg);
29
diff --git a/clamd/server-th.c b/clamd/server-th.c
30
index 9a3dd5b..8d81bb8 100644
31
--- a/clamd/server-th.c
32
+++ b/clamd/server-th.c
33
@@ -1037,7 +1037,7 @@ int recvloop_th(int *socketds, unsigned nsockets, struct cl_engine *engine, unsi
34
if((fd = fopen(opt->strarg, "w")) == NULL) {
35
logg("!Can't save PID in file %s\n", opt->strarg);
37
- if (fprintf(fd, "%u", (unsigned int) mainpid)<0) {
38
+ if (fprintf(fd, "%u\n", (unsigned int) mainpid)<0) {
39
logg("!Can't save PID in file %s\n", opt->strarg);
42
diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c
43
index 054e85e..a76d39f 100644
44
--- a/freshclam/freshclam.c
45
+++ b/freshclam/freshclam.c
46
@@ -138,7 +138,7 @@ writepid (const char *pidfile)
50
- fprintf (fd, "%d", (int) getpid ());
51
+ fprintf (fd, "%d\n", (int) getpid ());