X-Git-Url: http://git.onelab.eu/?p=fprobe-ulog.git;a=blobdiff_plain;f=src%2Ffprobe-ulog.c;h=519bf8f8b244cc01d6b5b94ccffaa73fc2abe12a;hp=bca3b5d3253759d39e55b033d86cbb4893e04fb3;hb=3da127fa885b32dc4614f2f69bc3f72a17215a82;hpb=466dcb566b08ec31ac3eb9946ec986b9e9f8c9c1 diff --git a/src/fprobe-ulog.c b/src/fprobe-ulog.c index bca3b5d..519bf8f 100644 --- a/src/fprobe-ulog.c +++ b/src/fprobe-ulog.c @@ -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; @@ -479,7 +479,7 @@ unsigned get_data_file_fd(char *fname, int cur_fd) { system(gzip_cmd); } snprintf(cur_output_file,MAX_PATH_LEN,"%s.%d",fname,cur_epoch); - if ((write_fd = open(cur_output_file, O_RDWR|O_CREAT|O_TRUNC)) < 0) { + if ((write_fd = open(cur_output_file, O_RDWR|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH)) < 0) { my_log(LOG_ERR, "open(): %s (%s)\n", cur_output_file, strerror(errno)); exit(1); } @@ -825,8 +825,6 @@ void *emit_thread() setuser(); - //pthread_mutexattr_setprotocol(&md->MutexAttr,PTHREAD_PRIO_INHERIT); - for (;;) { pthread_mutex_lock(&emit_mutex); while (!flows_emit) { @@ -834,7 +832,7 @@ void *emit_thread() timeout.tv_sec = now.tv_sec + emit_timeout; /* Do not wait until emit_packet will filled - it may be too long */ if (pthread_cond_timedwait(&emit_cond, &emit_mutex, &timeout) && emit_count) { - my_log(LOG_INFO,"Timeout: %d, %d",emit_count, timeout.tv_sec); + //my_log(LOG_INFO,"Timeout: %d, %d",emit_count, timeout.tv_sec); pthread_mutex_unlock(&emit_mutex); goto sendit; }