~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to debian/patches/0002-Add-an-additional-n-after-the-number-in-the-pidfile.patch

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
6
start-stop-daemon works without the \n in the file but pkill does not.
 
7
Also the output of cat $PifFile looks better :)
 
8
 
 
9
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
 
10
---
 
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(-)
 
15
 
 
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);
 
23
        } else {
 
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);
 
27
            }
 
28
            fclose(fd);
 
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);
 
36
        } else {
 
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);
 
40
            }
 
41
            fclose(fd);
 
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)
 
47
     }
 
48
     else
 
49
     {
 
50
-        fprintf (fd, "%d", (int) getpid ());
 
51
+        fprintf (fd, "%d\n", (int) getpid ());
 
52
         fclose (fd);
 
53
     }
 
54
     umask (old_umask);