Added acceptable modes in call to open with O_CREAT
authorsapanb <sapanb@8c455092-636d-4788-adf5-e71def0336e8>
Fri, 8 Jul 2011 15:16:26 +0000 (15:16 +0000)
committersapanb <sapanb@8c455092-636d-4788-adf5-e71def0336e8>
Fri, 8 Jul 2011 15:16:26 +0000 (15:16 +0000)
git-svn-id: http://svn.planet-lab.org/svn/fprobe-ulog/trunk@18793 8c455092-636d-4788-adf5-e71def0336e8

src/fprobe-ulog.c

index bca3b5d..0dc3071 100644 (file)
@@ -418,7 +418,7 @@ void update_cur_epoch_file(int n) {
        int fd, len;
        char snum[MAX_EPOCH_SIZE];
        len=snprintf(snum, MAX_EPOCH_SIZE-1,"%d", n);
-       fd = open(LAST_EPOCH_FILE, O_RDWR|O_CREAT|O_TRUNC);
+       fd = open(LAST_EPOCH_FILE, O_RDWR|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
        if (fd == -1) {
                my_log(LOG_ERR, "open() failed: %s.The next restart will resume logging from epoch id 0.",LAST_EPOCH_FILE);
                return;