mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Merge branch 'master' into topic/jsiwek/broxygen
This commit is contained in:
commit
68227f112d
89 changed files with 792 additions and 245 deletions
19
src/util.cc
19
src/util.cc
|
@ -935,7 +935,7 @@ static const char* check_for_dir(const char* filename, bool load_pkgs)
|
|||
return copy_string(filename);
|
||||
}
|
||||
|
||||
FILE* open_file(const char* filename, const char** full_filename, bool load_pkgs)
|
||||
static FILE* open_file(const char* filename, const char** full_filename, bool load_pkgs)
|
||||
{
|
||||
filename = check_for_dir(filename, load_pkgs);
|
||||
|
||||
|
@ -944,6 +944,13 @@ FILE* open_file(const char* filename, const char** full_filename, bool load_pkgs
|
|||
|
||||
FILE* f = fopen(filename, "r");
|
||||
|
||||
if ( ! f )
|
||||
{
|
||||
char buf[256];
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
reporter->Error("Failed to open file %s: %s", filename, buf);
|
||||
}
|
||||
|
||||
delete [] filename;
|
||||
|
||||
return f;
|
||||
|
@ -1259,6 +1266,16 @@ void _set_processing_status(const char* status)
|
|||
|
||||
int fd = open(proc_status_file, O_CREAT | O_WRONLY | O_TRUNC, 0700);
|
||||
|
||||
if ( fd < 0 )
|
||||
{
|
||||
char buf[256];
|
||||
strerror_r(errno, buf, sizeof(buf));
|
||||
reporter->Error("Failed to open process status file '%s': %s",
|
||||
proc_status_file, buf);
|
||||
errno = old_errno;
|
||||
return;
|
||||
}
|
||||
|
||||
int len = strlen(status);
|
||||
while ( len )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue