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:
Johanna Amann 2017-09-18 14:43:42 -07:00
parent 2a873f5aed
commit fc33bf2014
13 changed files with 63 additions and 18 deletions

View file

@ -20,7 +20,7 @@ Extract::Extract(RecordVal* args, File* file, const string& arg_filename,
{
fd = 0;
char buf[128];
strerror_r(errno, buf, sizeof(buf));
bro_strerror_r(errno, buf, sizeof(buf));
reporter->Error("cannot open %s: %s", filename.c_str(), buf);
}
}