The following commit has been merged in the master branch:
commit 3bbdfa787d98084a682a404921e8bed6b5be8442
Author: Guillem Jover <[email protected]>
Date:   Thu May 21 06:00:41 2009 +0200

    s-s-d: Add new warning function
    
    Switch a previous ad-hoc warning message to use the new warning
    function, which additionally properly prints to stderr.

diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 47f6af3..b34d171 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -220,6 +220,17 @@ static void badusage(const char *msg)
        NONRETURNING;
 
 static void
+warning(const char *format, ...)
+{
+       va_list arglist;
+
+       fprintf(stderr, "%s: warning: ", progname);
+       va_start(arglist, format);
+       vfprintf(stderr, format, arglist);
+       va_end(arglist);
+}
+
+static void
 fatal(const char *format, ...)
 {
        va_list arglist;
@@ -1249,8 +1260,8 @@ do_stop(int signal_nr, int quietmode, int *n_killed, int 
*n_notkilled, int retry
                        (*n_killed)++;
                } else {
                        if (signal_nr)
-                               printf("%s: warning: failed to kill %d: %s\n",
-                                      progname, p->pid, strerror(errno));
+                               warning("failed to kill %d: %s\n",
+                                       p->pid, strerror(errno));
                        (*n_notkilled)++;
                }
        }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to