git://git.onelab.eu
/
fprobe-ulog.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modify bits for old files also.
[fprobe-ulog.git]
/
src
/
fprobe-ulog.c
diff --git
a/src/fprobe-ulog.c
b/src/fprobe-ulog.c
index
37ecde3
..
a9f0461
100644
(file)
--- a/
src/fprobe-ulog.c
+++ b/
src/fprobe-ulog.c
@@
-474,10
+474,13
@@
unsigned get_data_file_fd(char *fname, int cur_fd) {
if (cur_fd>0)
close(cur_fd);
snprintf(nextname,MAX_PATH_LEN,"%s.%d",fname,cur_epoch);
if (cur_fd>0)
close(cur_fd);
snprintf(nextname,MAX_PATH_LEN,"%s.%d",fname,cur_epoch);
- if ((write_fd = open(nextname, O_RDWR|O_CREAT|O_TRUNC
,S_IRWXU|S_IRGRP|S_IROTH
)) < 0) {
+ if ((write_fd = open(nextname, O_RDWR|O_CREAT|O_TRUNC)) < 0) {
my_log(LOG_ERR, "open(): %s (%s)\n", nextname, strerror(errno));
exit(1);
}
my_log(LOG_ERR, "open(): %s (%s)\n", nextname, strerror(errno));
exit(1);
}
+ if (fchmod(write_fd,S_IRUSR|S_IWUSR|S_IROTH|S_IRGRP) == -1) {
+ my_log(LOG_ERR, "fchmod() failed: %s (%s). Continuing...\n", nextname, strerror(errno));
+ }
update_cur_epoch_file(cur_epoch);
ret_fd = write_fd;
}
update_cur_epoch_file(cur_epoch);
ret_fd = write_fd;
}