Changes in / [9ae6095:61ad0cb2]
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r7dcef03 rb61ad80 1227 1227 time_t now; 1228 1228 va_list ap; 1229 va_start(ap, fmt);1230 1229 1231 1230 if (!owl_global_is_debug_fast(&g)) … … 1242 1241 (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g)); 1243 1242 g_free(tmpbuff); 1243 1244 va_start(ap, fmt); 1244 1245 vfprintf(file, fmt, ap); 1246 va_end(ap); 1247 1245 1248 putc('\n', file); 1246 1249 fflush(file); 1247 1248 va_end(ap);1249 1250 } 1250 1251 -
util.c
r7b89e8c rcba6b9c 468 468 if (fstat(fileno(old), &st) != 0) { 469 469 owl_function_error("Cannot stat %s: %s", filename, strerror(errno)); 470 fclose(old); 470 471 return -1; 471 472 } … … 473 474 /* resolve symlinks, because link() fails on symlinks, at least on AFS */ 474 475 actual_filename = owl_util_recursive_resolve_link(filename); 475 if (actual_filename == NULL) 476 if (actual_filename == NULL) { 477 fclose(old); 476 478 return -1; /* resolving the symlink failed, but we already logged this error */ 479 } 477 480 478 481 newfile = g_strdup_printf("%s.new", actual_filename); -
variable.c
r7dcef03 r94b9ee0 1038 1038 CALLER_OWN char *owl_variable_bool_get_tostring_default(const owl_variable *v, void *dummy) 1039 1039 { 1040 bool val = owl_variable_get_bool(v); 1041 if (val == 0) { 1042 return g_strdup("off"); 1043 } else if (val == 1) { 1044 return g_strdup("on"); 1045 } else { 1046 return g_strdup("<invalid>"); 1047 } 1040 return g_strdup(owl_variable_get_bool(v) ? "on" : "off"); 1048 1041 } 1049 1042 -
zephyr.c
r7dcef03 r18380fd 283 283 #ifdef HAVE_LIBZEPHYR 284 284 FILE *file; 285 int fopen_errno; 285 286 char *tmp, *start; 286 287 char *buffer = NULL; … … 289 290 int subSize = 1024; 290 291 int count; 291 struct stat statbuff;292 292 293 293 subsfile = owl_zephyr_dotfile(".zephyr.subs", filename); 294 294 295 if (stat(subsfile, &statbuff) != 0) { 296 g_free(subsfile); 297 if (error_on_nofile == 1) 295 count = 0; 296 file = fopen(subsfile, "r"); 297 fopen_errno = errno; 298 g_free(subsfile); 299 if (!file) { 300 if (error_on_nofile == 1 || fopen_errno != ENOENT) 298 301 return -1; 299 302 return 0; 300 303 } 301 302 ZResetAuthentication();303 count = 0;304 file = fopen(subsfile, "r");305 g_free(subsfile);306 if (!file)307 return -1;308 304 309 305 subs = g_new(ZSubscription_t, subSize); … … 348 344 g_free(buffer); 349 345 346 ZResetAuthentication(); 350 347 return owl_zephyr_loadsubs_helper(subs, count); 351 348 #else … … 412 409 char *buffer = NULL; 413 410 int count; 414 struct stat statbuff;415 411 416 412 subs = g_new(ZSubscription_t, numSubs); 417 413 subsfile = owl_zephyr_dotfile(".anyone", filename); 418 414 419 if (stat(subsfile, &statbuff) == -1) {420 g_free(subs);421 g_free(subsfile);422 return 0;423 }424 425 ZResetAuthentication();426 415 count = 0; 427 416 file = fopen(subsfile, "r"); … … 445 434 fclose(file); 446 435 } else { 436 g_free(subs); 447 437 return 0; 448 438 } 449 439 g_free(buffer); 450 440 441 ZResetAuthentication(); 451 442 return owl_zephyr_loadsubs_helper(subs, count); 452 443 #else
Note: See TracChangeset
for help on using the changeset viewer.