]> rtime.felk.cvut.cz Git - sojka/can-utils.git/blobdiff - slcand.c
can-utils: AOSP build clean up
[sojka/can-utils.git] / slcand.c
index 334c718dafe52e445782d98dc2c5918c4b72b324..807ffaa81e7180bbe84333b7f295b36119ea1907 100644 (file)
--- a/slcand.c
+++ b/slcand.c
@@ -1,7 +1,3 @@
-/*
- *  $Id$
- */
-
 /*
  * slcand.c - userspace daemon for serial line CAN interface driver SLCAN
  *
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <syslog.h>
 #include <errno.h>
 #include <pwd.h>
 #include <signal.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <net/if.h>
 
 /* default slcan line discipline since Kernel 2.6.25 */
@@ -98,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;
@@ -185,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));
@@ -246,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;