X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Faklog%2Faklog.c;h=988d54cce56d2f36276a9b862d6fbf930ea50944;hp=7d190bd836c00ce91f2d9162db312d250333d37b;hb=877d9d79a32b9e81911cb567f844b11c693229f0;hpb=e14a69cf925172d699c2ff31078f8a634a90747f diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index 7d190bd..988d54c 100644 --- a/src/aklog/aklog.c +++ b/src/aklog/aklog.c @@ -383,19 +383,24 @@ get_cellconfig(const char *config, char *cell, exit(AKLOG_AFS); } - if (afsconf_GetLocalCell(configdir, *local_cell, MAXCELLCHARS)) { - fprintf(stderr, "%s: can't determine local cell.\n", progname); - exit(AKLOG_AFS); + if (cell != NULL && cell[0] == '\0') { + /* Use the local cell */ + cell = NULL; } - if ((cell == NULL) || (cell[0] == 0)) - cell = *local_cell; - /* XXX - This function modifies 'cell' by passing it through lcstring */ if (afsconf_GetCellInfo(configdir, cell, NULL, cellconfig)) { - fprintf(stderr, "%s: Can't get information about cell %s.\n", - progname, cell); + if (cell != NULL) { + fprintf(stderr, "%s: Can't get information about cell %s.\n", + progname, cell); + } else { + fprintf(stderr, "%s: Can't get information about the local cell.\n", + progname); + } status = AKLOG_AFS; + } else if (afsconf_GetLocalCell(configdir, *local_cell, MAXCELLCHARS)) { + fprintf(stderr, "%s: can't determine local cell.\n", progname); + exit(AKLOG_AFS); } afsconf_Close(configdir);