]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tunelp: check fstat return code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 21 Jun 2012 11:11:08 +0000 (13:11 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Jun 2012 11:11:08 +0000 (13:11 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/tunelp.c

index 4d9038aecd7632fc0b0866c4ebd8c718a58a17c2..5efd6021c4f113d4f5b86cda28856a21da06d8e7 100644 (file)
@@ -264,7 +264,8 @@ int main(int argc, char **argv)
        if (fd < 0)
                err(EXIT_FAILURE, "%s", filename);
 
-       fstat(fd, &statbuf);
+       if (fstat(fd, &statbuf))
+               err(EXIT_FAILURE, "%s: stat() failed", filename);
 
        if (!S_ISCHR(statbuf.st_mode)) {
                warnx(_("%s not an lp device"), filename);