Changeset 61ad0cb2


Ignore:
Timestamp:
May 5, 2014, 6:44:45 AM (8 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Parents:
9ae6095 (diff), 94b9ee0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 94b9ee074ae76ef2e585605ccf56f030d02378a6 into 9ae6095ed62f67742f9d4dc1008180e8d23e7b12
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r7dcef03 rb61ad80  
    12271227  time_t now;
    12281228  va_list ap;
    1229   va_start(ap, fmt);
    12301229
    12311230  if (!owl_global_is_debug_fast(&g))
     
    12421241          (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g));
    12431242  g_free(tmpbuff);
     1243
     1244  va_start(ap, fmt);
    12441245  vfprintf(file, fmt, ap);
     1246  va_end(ap);
     1247
    12451248  putc('\n', file);
    12461249  fflush(file);
    1247 
    1248   va_end(ap);
    12491250}
    12501251
  • util.c

    r7b89e8c rcba6b9c  
    468468  if (fstat(fileno(old), &st) != 0) {
    469469    owl_function_error("Cannot stat %s: %s", filename, strerror(errno));
     470    fclose(old);
    470471    return -1;
    471472  }
     
    473474  /* resolve symlinks, because link() fails on symlinks, at least on AFS */
    474475  actual_filename = owl_util_recursive_resolve_link(filename);
    475   if (actual_filename == NULL)
     476  if (actual_filename == NULL) {
     477    fclose(old);
    476478    return -1; /* resolving the symlink failed, but we already logged this error */
     479  }
    477480
    478481  newfile = g_strdup_printf("%s.new", actual_filename);
  • variable.c

    r7dcef03 r94b9ee0  
    10381038CALLER_OWN char *owl_variable_bool_get_tostring_default(const owl_variable *v, void *dummy)
    10391039{
    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");
    10481041}
    10491042
  • zephyr.c

    r7dcef03 r18380fd  
    283283#ifdef HAVE_LIBZEPHYR
    284284  FILE *file;
     285  int fopen_errno;
    285286  char *tmp, *start;
    286287  char *buffer = NULL;
     
    289290  int subSize = 1024;
    290291  int count;
    291   struct stat statbuff;
    292292
    293293  subsfile = owl_zephyr_dotfile(".zephyr.subs", filename);
    294294
    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)
    298301      return -1;
    299302    return 0;
    300303  }
    301 
    302   ZResetAuthentication();
    303   count = 0;
    304   file = fopen(subsfile, "r");
    305   g_free(subsfile);
    306   if (!file)
    307     return -1;
    308304
    309305  subs = g_new(ZSubscription_t, subSize);
     
    348344    g_free(buffer);
    349345
     346  ZResetAuthentication();
    350347  return owl_zephyr_loadsubs_helper(subs, count);
    351348#else
     
    412409  char *buffer = NULL;
    413410  int count;
    414   struct stat statbuff;
    415411
    416412  subs = g_new(ZSubscription_t, numSubs);
    417413  subsfile = owl_zephyr_dotfile(".anyone", filename);
    418414
    419   if (stat(subsfile, &statbuff) == -1) {
    420     g_free(subs);
    421     g_free(subsfile);
    422     return 0;
    423   }
    424 
    425   ZResetAuthentication();
    426415  count = 0;
    427416  file = fopen(subsfile, "r");
     
    445434    fclose(file);
    446435  } else {
     436    g_free(subs);
    447437    return 0;
    448438  }
    449439  g_free(buffer);
    450440
     441  ZResetAuthentication();
    451442  return owl_zephyr_loadsubs_helper(subs, count);
    452443#else
Note: See TracChangeset for help on using the changeset viewer.