(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:
Ron Koenderink 2007-03-10 16:29:51 +00:00
parent 32d62797d2
commit c97d79c0ee
6 changed files with 32 additions and 12 deletions

View file

@ -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);