Changeset 18380fd
- Timestamp:
- May 5, 2014, 6:44:00 AM (10 years ago)
- Branches:
- master, release-1.10
- Children:
- 94b9ee0
- Parents:
- b61ad80
- git-author:
- Anders Kaseorg <andersk@mit.edu> (04/23/14 02:55:30)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (05/05/14 06:44:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.