Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0f74071

Browse files
committed
remove temp code
1 parent ac476ff commit 0f74071

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎cron_support.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void free_command_token(CommandToken *command) // 명령행 구조체 초기화
5858
/**
5959
* @brief 예약 명령 목록 가져오기
6060
*/
61-
int get_reservation_command(void) // 예약 명령 목록 가져오
61+
int get_reservation_command(void) // 예약 명령 목록 가져오기
6262
{
6363
FILE *fp;
6464

@@ -89,10 +89,10 @@ void write_log(int command_type, char *command) // 로그 파일에 이력 기
8989
time_t now_t;
9090
struct tm *now_tm;
9191

92-
pthread_mutex_lock(&mutex);
92+
pthread_mutex_lock(&mutex);// Mutex lock을 통해 Thread-safe 하게 로그 저장
9393

94-
if ((fp = fopen(CRONTAB_LOG, "r+")) == NULL)
95-
fp = fopen(CRONTAB_LOG, "w");
94+
if ((fp = fopen(CRONTAB_LOG, "r+")) == NULL)// 로그 파일이 존재하지 않을 경우
95+
fp = fopen(CRONTAB_LOG, "w");// 로그 파일 생성
9696

9797
fseek(fp, 0, SEEK_END);
9898

@@ -101,15 +101,12 @@ void write_log(int command_type, char *command) // 로그 파일에 이력 기
101101

102102
switch (command_type) {
103103
case ADD:
104-
//sprintf(temp, "echo \"[%.24s] %s %s\" >> %s", asctime(now_tm), "add", command, CRONTAB_LOG);
105104
fprintf(fp, "[%.24s] %s %s\n", asctime(now_tm), "add", command);
106105
break;
107106
case REMOVE:
108-
//sprintf(temp, "echo \"[%.24s] %s %s\" >> %s", asctime(now_tm), "remove", command, CRONTAB_LOG);
109107
fprintf(fp, "[%.24s] %s %s\n", asctime(now_tm), "remove", command);
110108
break;
111109
case RUN:
112-
//sprintf(temp, "echo \"[%.24s] %s %s\" >> %s", asctime(now_tm), "run", command, CRONTAB_LOG);
113110
fprintf(fp, "[%.24s] %s %s\n", asctime(now_tm), "run", command);
114111
break;
115112
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /