-/*
- * $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 */
}
}
-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;
}
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));
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;