diff options
author | Johann Latocha | 2012-05-08 23:40:35 +0200 |
---|---|---|
committer | Johann Latocha | 2012-05-08 23:40:35 +0200 |
commit | e94396f4cf420642f551b8815e031c45bd0aaa7f (patch) | |
tree | 8d85c04413802fcdc338a50c864c84785bc3bc51 /src/client | |
parent | [KERNEL] rtt measurement improved (diff) | |
download | dnbd3-e94396f4cf420642f551b8815e031c45bd0aaa7f.tar.gz dnbd3-e94396f4cf420642f551b8815e031c45bd0aaa7f.tar.xz dnbd3-e94396f4cf420642f551b8815e031c45bd0aaa7f.zip |
[KERNEL] Set proper exit status on connection
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); } |