]> rtime.felk.cvut.cz Git - sojka/can-utils.git/commitdiff
slcand: fix build warnings
authorYegor Yefremov <yegorslists@googlemail.com>
Mon, 4 Feb 2013 09:10:22 +0000 (10:10 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Feb 2013 11:11:32 +0000 (12:11 +0100)
Remove unused variable name.

Fix FILE pointer check (fopen() returns a pointer not an integer).

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
slcand.c

index 2353c994dee6ddc11e47f67438b9585cc2995337..807ffaa81e7180bbe84333b7f295b36119ea1907 100644 (file)
--- a/slcand.c
+++ b/slcand.c
@@ -95,7 +95,7 @@ static void child_handler (int signum)
        }
 }
 
-static void daemonize (const char *lockfile, char *tty, char *name)
+static void daemonize (const char *lockfile, char *tty)
 {
        pid_t pid, sid, parent;
        int lfp = -1;
@@ -182,7 +182,7 @@ static void daemonize (const char *lockfile, char *tty, char *name)
        }
 
        pFile = fopen (pidfile,"w");
-       if (pFile < 0)
+       if (pFile == NULL)
        {
                syslog (LOG_ERR, "unable to create pid file %s, code=%d (%s)",
                        pidfile, errno, strerror (errno));
@@ -243,7 +243,7 @@ int main (int argc, char *argv[])
        syslog (LOG_INFO, "starting on TTY device %s", ttypath);
 
        /* Daemonize */
-       daemonize ("/var/lock/" DAEMON_NAME, tty, name);
+       daemonize ("/var/lock/" DAEMON_NAME, tty);
 
        /* Now we are a daemon -- do the work for which we were paid */
        int fd;