We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c7512e commit 3dbe27eCopy full SHA for 3dbe27e
cron_support.c
@@ -6,7 +6,7 @@
6
#include "cron_support.h"
7
8
FILE *fp;
9
-pthread_mutex_t mutex; // 뮤텍스 객체 선언
+pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER; // 뮤텍스 객체 선언
10
extern char reservation_command[BUFFER_SIZE][MAX_BUFFER_SIZE]; // 예약 명령 목록
11
12
/**
@@ -90,11 +90,10 @@ void write_log(int command_type, char *command) // 로그 파일에 이력 기
90
struct tm *now_tm;
91
92
pthread_mutex_lock(&mutex);
93
+
94
if ((fp = fopen(CRONTAB_LOG, "r+")) == NULL)
- {
95
- fprintf(stderr, "write_log: fopen error for %s\n", CRONTAB_LOG);
96
- return;
97
- }
+ fp = fopen(CRONTAB_LOG, "w");
98
fseek(fp, 0, SEEK_END);
99
100
time(&now_t);
@@ -114,8 +113,6 @@ void write_log(int command_type, char *command) // 로그 파일에 이력 기
114
113
fprintf(fp, "[%.24s] %s %s\n", asctime(now_tm), "run", command);
115
break;
116
}
117
- //system(temp);
118
- //fflush(fp);
119
fclose(fp);
120
pthread_mutex_unlock(&mutex);
121
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments