int _afsconf_Check(struct afsconf_dir *adir) { /* did configuration change? */ if (_afsconf_UpToDate(adir)) return 0; /* otherwise file has changed, so reopen it */ return afsconf_Reopen(adir); }
static int afsconf_Check(struct afsconf_dir *adir) { char tbuffer[256]; #ifdef AFS_NT40_ENV char *p; #endif struct stat tstat; afs_int32 code; #ifdef AFS_NT40_ENV /* NT client CellServDB has different file name than NT server or Unix */ if (IsClientConfigDirectory(adir->name)) { if (!afssw_GetClientCellServDBDir(&p)) { strcompose(tbuffer, sizeof(tbuffer), p, "/", AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL); free(p); } else { int len; strncpy(tbuffer, adir->name, sizeof(tbuffer)); len = (int)strlen(tbuffer); if (tbuffer[len - 1] != '\\' && tbuffer[len - 1] != '/') { strncat(tbuffer, "\\", sizeof(tbuffer)); } strncat(tbuffer, AFSDIR_CELLSERVDB_FILE_NTCLIENT, sizeof(tbuffer)); tbuffer[sizeof(tbuffer) - 1] = '\0'; } } else { strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); } #else strcompose(tbuffer, 256, adir->name, "/", AFSDIR_CELLSERVDB_FILE, NULL); #endif /* AFS_NT40_ENV */ code = stat(tbuffer, &tstat); if (code < 0) { return code; } /* did file change? */ if (tstat.st_mtime == adir->timeRead) { return 0; } /* otherwise file has changed, so reopen it */ return afsconf_Reopen(adir); }