]> rtime.felk.cvut.cz Git - can-utils.git/blobdiff - slcand.c
slcand: consistent use of exit(EXIT_FAILURE)
[can-utils.git] / slcand.c
index 55775daab9d27bfe8331c56c7cd7eb2adb3f690f..b72fa4e8eeb756a7c5fc9ec4ef1f790899e83864 100644 (file)
--- a/slcand.c
+++ b/slcand.c
@@ -50,9 +50,6 @@
 /* The length of ttypath buffer */
 #define TTYPATH_LENGTH 64
 
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
-
 /* UART flow control types */
 #define FLOW_NONE 0
 #define FLOW_HW 1
@@ -337,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);
@@ -362,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);