tunelp: check fstat return code [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-06-21 13:11:08 +02:00
parent 32c67d2c58
commit 97209c2be1
1 changed files with 2 additions and 1 deletions

View 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);