Be more verbose

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-05-09 15:27:57 +00:00
parent 0cce48e9fd
commit 5c532b2e56
4 changed files with 34 additions and 11 deletions

View File

@@ -99,9 +99,20 @@ gt_path(int argc, char **argv)
int fd = ctl_connect(GT_RUNDIR, dev);
if (fd == -1) {
perror("path");
ctl_delete(fd);
if (fd < 0) {
switch (fd) {
case -1:
perror("path");
break;
case -2:
gt_log("no device\n");
break;
case -3:
gt_log("please choose a device\n");
break;
default:
gt_log("couldn't connect\n");
}
return 1;
}