diff options
Diffstat (limited to 'tools/tools-shared.c')
-rw-r--r-- | tools/tools-shared.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/tools-shared.c b/tools/tools-shared.c index 3485ac2..c55e8ca 100644 --- a/tools/tools-shared.c +++ b/tools/tools-shared.c @@ -55,8 +55,10 @@ int open_device(const char *path) TRACE("Opening device '%s'.\n", path); fd = open(path, O_RDWR | O_NOCTTY); - if (fd < 1) + if (fd < 1) { perror("Failed to open device file"); + goto out; + } if (ioctl(fd, TIOCGSERIAL, &ser) == -1) { |