From: Hartmut Reuter Date: Mon, 12 Feb 2001 16:25:17 +0000 (+0000) Subject: bozo-save-old-cores-by-date-option-20010212 X-Git-Tag: BP-openafs-devel-autoconf~77 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=7dd378687b9f639a3e808c2e3179e78bd85a48a3 bozo-save-old-cores-by-date-option-20010212 compile-time option to save old cores by date instead of rotating --- diff --git a/src/bozo/bnode.c b/src/bozo/bnode.c index 8e16863..7f71b38 100644 --- a/src/bozo/bnode.c +++ b/src/bozo/bnode.c @@ -19,6 +19,9 @@ #include #include #endif +#ifdef BOZO_SAVE_CORES +#include +#endif #include #include /* signal(), kill(), wait(), etc. */ #include @@ -85,11 +88,25 @@ register struct bnode *abnode; { char tbuffer[256]; struct stat tstat; register afs_int32 code; +#ifdef BOZO_SAVE_CORES + struct timeval Start; + struct tm *TimeFields; + char FileName[256]; +#endif code = stat(AFSDIR_SERVER_CORELOG_FILEPATH, &tstat); if (code) return; bnode_CoreName(abnode, aproc->coreName, tbuffer); +#ifdef BOZO_SAVE_CORES + TM_GetTimeOfDay(&Start, 0); + TimeFields = localtime(&Start.tv_sec); + sprintf(FileName,"%s.%d%02d%02d%02d%02d%02d", tbuffer, + TimeFields->tm_year, TimeFields->tm_mon + 1, + TimeFields->tm_mday, TimeFields->tm_hour, TimeFields->tm_min, + TimeFields->tm_sec); + strcpy(tbuffer,FileName); +#endif code = renamefile(AFSDIR_SERVER_CORELOG_FILEPATH, tbuffer); }