comparison rogue3/rip.c @ 17:d67cac79f0f1

Change logf to logfi
author edwarj4
date Tue, 10 Nov 2009 22:48:16 +0000
parents a731f515575e
children 95e2bbb7b6e0
comparison
equal deleted inserted replaced
16:a731f515575e 17:d67cac79f0f1
123 /* Same thing, but for the log file. Maybe combine them eventually. */ 123 /* Same thing, but for the log file. Maybe combine them eventually. */
124 /* FIXME you don't know what this does */ 124 /* FIXME you don't know what this does */
125 void open_log(void) 125 void open_log(void)
126 { 126 {
127 #ifdef LOGFILE 127 #ifdef LOGFILE
128 if (logf != NULL) { 128 if (logfi != NULL) {
129 rewind(logf); 129 rewind(logfi);
130 return; 130 return;
131 } 131 }
132 132
133 logf = fopen(LOGFILE, "a"); 133 logfi = fopen(LOGFILE, "a");
134 134
135 if (logf == NULL) 135 if (logfi == NULL)
136 { 136 {
137 fprintf(stderr, "Could not open %s for appending: %s\n", LOGFILE, strerror(errno)); 137 fprintf(stderr, "Could not open %s for appending: %s\n", LOGFILE, strerror(errno));
138 fflush(stderr); 138 fflush(stderr);
139 } 139 }
140 #else 140 #else
141 logf == NULL; 141 logfi == NULL;
142 #endif 142 #endif
143 return; 143 return;
144 } 144 }
145 #endif 145 #endif
146 146
353 strcat(logmessage, ltemp); 353 strcat(logmessage, ltemp);
354 } 354 }
355 else 355 else
356 return; 356 return;
357 357
358 logf = fopen(LOGFILE, "a"); /* permissions? */ 358 logfi = fopen(LOGFILE, "a"); /* permissions? */
359 if (logf == NULL) 359 if (logfi == NULL)
360 return; 360 return;
361 /* and write it */ 361 /* and write it */
362 md_lockfile(logf); 362 md_lockfile(logfi);
363 fprintf(logf, "%s", logmessage); 363 fprintf(logfi, "%s", logmessage);
364 md_unlockfile(logf); 364 md_unlockfile(logfi);
365 fclose(logf); 365 fclose(logfi);
366 #endif 366 #endif
367 return; 367 return;
368 } 368 }
369 369
370 void 370 void