(add, disa, ef_open, logerror, main): Switch permissions to
standard defines instead of magic numbers to improve portability. Also define WIN32 equivalents to the standard defines.
This commit is contained in:
parent
32d62797d2
commit
c97d79c0ee
6 changed files with 32 additions and 12 deletions
|
@ -40,6 +40,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
@ -93,7 +94,8 @@ logerror(char *format, ...)
|
|||
time(&now);
|
||||
memcpy(buf, ctime(&now), ctime_len);
|
||||
buf[ctime_len] = ' ';
|
||||
if ((logf = open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0660)) < 0)
|
||||
if ((logf = open(logfile, O_WRONLY | O_CREAT | O_APPEND,
|
||||
S_IRWUG)) < 0)
|
||||
return;
|
||||
write(logf, buf, strlen(buf));
|
||||
close(logf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue