]> rtime.felk.cvut.cz Git - can-utils.git/commitdiff
slcand: consistent use of exit(EXIT_FAILURE)
authorJeremiah Mahler <jmmahler@gmail.com>
Fri, 19 Dec 2014 15:22:18 +0000 (07:22 -0800)
committerOliver Hartkopp <socketcan@hartkopp.net>
Tue, 23 Dec 2014 17:02:52 +0000 (18:02 +0100)
Some places used exit(1) and others used exit(EXIT_FAILURE).
Be consistent and use exit(EXIT_FAILURE) for all of these instances.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
slcand.c

index c4c81c54bbcf2d1b7bfffd51fb6f987764404797..b72fa4e8eeb756a7c5fc9ec4ef1f790899e83864 100644 (file)
--- a/slcand.c
+++ b/slcand.c
@@ -334,13 +334,13 @@ int main(int argc, char *argv[])
        /* set slcan like discipline on given tty */
        if (ioctl(fd, TIOCSETD, &ldisc) < 0) {
                perror("ioctl TIOCSETD");
-               exit(1);
+               exit(EXIT_FAILURE);
        }
        
        /* retrieve the name of the created CAN netdevice */
        if (ioctl(fd, SIOCGIFNAME, buf) < 0) {
                perror("ioctl SIOCGIFNAME");
-               exit(1);
+               exit(EXIT_FAILURE);
        }
 
        syslog(LOG_NOTICE, "attached TTY %s to netdevice %s\n", ttypath, buf);
@@ -359,7 +359,7 @@ int main(int argc, char *argv[])
                        if (ioctl(s, SIOCSIFNAME, &ifr) < 0) {
                                syslog(LOG_NOTICE, "netdevice %s rename to %s failed\n", buf, name);
                                perror("ioctl SIOCSIFNAME rename");
-                               exit(1);
+                               exit(EXIT_FAILURE);
                        } else
                                syslog(LOG_NOTICE, "netdevice %s renamed to %s\n", buf, name);