]> rtime.felk.cvut.cz Git - can-utils.git/commitdiff
slcand: silence warning about set but unused variable
authorOliver Hartkopp <socketcan@hartkopp.net>
Mon, 16 Sep 2013 07:08:56 +0000 (09:08 +0200)
committerOliver Hartkopp <socketcan@hartkopp.net>
Mon, 16 Sep 2013 07:08:56 +0000 (09:08 +0200)
The dummyFile pointer was only needed to redirect stdxxx streams but it's
content was never used. Re-use the pFile pointer for this reason which is
unused at that point to silent the compiler warning about the set and unused
dummyFile variable.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
slcand.c

index 323f4ec3b04d6557a7de3096922f3f5911d25960..30f5127f8cd8b293643acea9af584c1ed58fcf9c 100644 (file)
--- a/slcand.c
+++ b/slcand.c
@@ -177,7 +177,6 @@ static pid_t daemonize(const char *lockfile, char *tty, char *name)
        pid_t pid, sid, parent;
        int lfp = -1;
        FILE *pFile;
-       FILE *dummyFile;
        char const *pidprefix = "/var/run/";
        char const *pidsuffix = ".pid";
 
@@ -275,9 +274,9 @@ static pid_t daemonize(const char *lockfile, char *tty, char *name)
        }
 
        /* Redirect standard files to /dev/null */
-       dummyFile = freopen("/dev/null", "r", stdin);
-       dummyFile = freopen("/dev/null", "w", stdout);
-       dummyFile = freopen("/dev/null", "w", stderr);
+       pFile = freopen("/dev/null", "r", stdin);
+       pFile = freopen("/dev/null", "w", stdout);
+       pFile = freopen("/dev/null", "w", stderr);
 
        /* Tell the parent process that we are A-okay */
        /* kill(parent, SIGUSR1); */