mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Make strerror_r portable.
This uses the same code that broker already uses to determine if we use the XSI or gnu version of strerror_r. Patch by Thomas Petersen.
This commit is contained in:
parent
2a873f5aed
commit
fc33bf2014
13 changed files with 63 additions and 18 deletions
|
@ -302,7 +302,7 @@ FILE* BroFile::BringIntoCache()
|
|||
|
||||
if ( ! f )
|
||||
{
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
bro_strerror_r(errno, buf, sizeof(buf));
|
||||
reporter->Error("can't open %s: %s", name, buf);
|
||||
|
||||
f = fopen("/dev/null", "w");
|
||||
|
@ -313,7 +313,7 @@ FILE* BroFile::BringIntoCache()
|
|||
return f;
|
||||
}
|
||||
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
bro_strerror_r(errno, buf, sizeof(buf));
|
||||
reporter->Error("can't open /dev/null: %s", buf);
|
||||
return 0;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ FILE* BroFile::BringIntoCache()
|
|||
|
||||
if ( fseek(f, position, SEEK_SET) < 0 )
|
||||
{
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
bro_strerror_r(errno, buf, sizeof(buf));
|
||||
reporter->Error("reopen seek failed: %s", buf);
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ void BroFile::Suspend()
|
|||
if ( (position = ftell(f)) < 0 )
|
||||
{
|
||||
char buf[256];
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
bro_strerror_r(errno, buf, sizeof(buf));
|
||||
reporter->Error("ftell failed: %s", buf);
|
||||
position = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue