X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/can-utils.git/blobdiff_plain/722a09116d8685bbf3e7a833b56454adf3acfa4b..HEAD:/slcand.c diff --git a/slcand.c b/slcand.c index 334c718..807ffaa 100644 --- a/slcand.c +++ b/slcand.c @@ -1,7 +1,3 @@ -/* - * $Id$ - */ - /* * slcand.c - userspace daemon for serial line CAN interface driver SLCAN * @@ -44,14 +40,15 @@ #include #include #include -#include -#include #include #include #include #include #include +#include #include +#include +#include #include /* 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;