From e94396f4cf420642f551b8815e031c45bd0aaa7f Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Tue, 8 May 2012 23:40:35 +0200 Subject: [KERNEL] Set proper exit status on connection --- src/client/client.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/client') diff --git a/src/client/client.c b/src/client/client.c index 4810005..92f5127 100644 --- a/src/client/client.c +++ b/src/client/client.c @@ -158,7 +158,10 @@ int main(int argc, char *argv[]) printf("INFO: Closing device %s\n", dev); if (ioctl(fd, IOCTL_CLOSE, &msg) < 0) + { printf("ERROR: ioctl not successful\n"); + exit(EXIT_FAILURE); + } close(fd); exit(EXIT_SUCCESS); @@ -171,7 +174,10 @@ int main(int argc, char *argv[]) printf("INFO: Switching device %s to %s\n", dev, msg.host); if (ioctl(fd, IOCTL_SWITCH, &msg) < 0) + { printf("ERROR: ioctl not successful\n"); + exit(EXIT_FAILURE); + } close(fd); exit(EXIT_SUCCESS); @@ -184,7 +190,10 @@ int main(int argc, char *argv[]) printf("INFO: Connecting %s to %s:%s vid:%i rid:%i\n", dev, msg.host, msg.port, msg.vid, msg.rid); if (ioctl(fd, IOCTL_OPEN, &msg) < 0) + { printf("ERROR: ioctl not successful\n"); + exit(EXIT_FAILURE); + } close(fd); exit(EXIT_SUCCESS); @@ -218,7 +227,10 @@ int main(int argc, char *argv[]) printf("INFO: Connecting %s to %s:%s vid:%i rid:%i\n", dev, msg.host, msg.port, msg.vid, msg.rid); if (ioctl(fd, IOCTL_OPEN, &msg) < 0) + { printf("ERROR: ioctl not successful\n"); + exit(EXIT_FAILURE); + } close(fd); } -- cgit v1.2.3-55-g7522