mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 13:38:19 +00:00
Return false on error from the other place we call fstat()
This commit is contained in:
parent
529a3d8e77
commit
6b52c5b2f9
1 changed files with 4 additions and 5 deletions
|
@ -298,13 +298,12 @@ bool Raw::OpenInput()
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
if ( fstat(fileno(file.get()), &sb) == -1 )
|
if ( fstat(fileno(file.get()), &sb) == -1 )
|
||||||
{
|
{
|
||||||
|
// This is unlikely to fail
|
||||||
Error(Fmt("Could not get fstat for %s", fname.c_str()));
|
Error(Fmt("Could not get fstat for %s", fname.c_str()));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
ino = sb.st_ino;
|
||||||
{
|
dev = sb.st_dev;
|
||||||
ino = sb.st_ino;
|
|
||||||
dev = sb.st_dev;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! SetFDFlags(fileno(file.get()), F_SETFD, FD_CLOEXEC) )
|
if ( ! SetFDFlags(fileno(file.get()), F_SETFD, FD_CLOEXEC) )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue