slcand: fix build warnings
PATCH 1/1 slcand: fix build warnings
From: Yegor Yefremov <[email protected]>
Remove unused variable name.
Fix FILE pointer check (fopen() returns a pointer not an integer).
Signed-off-by Yegor Yefremov <[email protected]>
--- slcand.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
slcand.c +3 -3
@@ -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;
Signature · 1 line
1.7.7
Quoted 7 lines · On 02/04/2013 10:10 AM, [email protected] wrote:
From: Yegor Yefremov <[email protected]>
Remove unused variable name.
Fix FILE pointer check (
fopen()returns a pointer not an integer).Signed-off-by Yegor Yefremov <[email protected]>
Applied.
tnx,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |