main(int argc, char *argv[]) { if (TestAndLock()) { fprintf(stderr, "Another unwind running or abandoned, please check\n"); exit(EXIT_FAILURE); } ParseArgs(argc, argv); InitSignals(); InitLog(); if (chdir(CodaUserDir)) { RemoveLock(); Die("Could not cd into %s", CodaUserDir); } if (InitDB(DataBaseName)) { RemoveLock(); fprintf(stderr, "Could not connect to database %s", DataBaseName); exit(EXIT_FAILURE); } LogMsg(100, LogLevel, LogFile, "Enter ProcessEachUser"); ProcessEachUser(); RemoveLock(); Log_Done(); }
main (int argc, char *argv[]) { if (TestAndLock()) { fprintf(stderr, "Another unwind running or abandoned, please check\n"); exit(-1); } ParseArgs(argc, argv); InitSignals(); InitLog(); if (chdir(WorkingDir)) { RemoveLock(); Die("Could not cd into %s",WorkingDir); } if (InitDB(DataBaseName)) { RemoveLock(); fprintf(stderr,"Could not connect to database %s",DataBaseName); exit(-1); } GetFilesAndSpool(); RemoveLock(); Log_Done(); }