Changeset 810 for branches


Ignore:
Timestamp:
Sep 23, 2006, 8:58:17 AM (13 years ago)
Author:
andree
Message:

Fix new time stamp log feature:

  • use ctime() which gives human-readable time output rather than get_time() which gives seconds since epoch (also fixes segmentation fault caused by get_date() returning long and out being %s);
  • unlink the log _before_ start time is written to it so we don't lose it
  • call it 'time' rather than 'date' plus some cosmetics
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/mondoarchive/main.c

    r807 r810  
    251251    int res, retval;
    252252    char *say_at_end;
     253    time_t tcurr;
    253254
    254255/* Make sure I'm root; abort if not */
     
    281282    }
    282283
    283     log_msg(0, "Start date : %s", get_time());
     284    /* initialize log file with time stamp */
     285    unlink(MONDO_LOGFILE);
     286    tcurr = time(NULL);
     287    log_msg(0, "Time started: %s", ctime(&tcurr));
    284288
    285289    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
     
    300304    /* Add MONDO_SHARE environment variable for mindi */
    301305    setenv_mondo_share();
    302 
    303     unlink(MONDO_LOGFILE);
    304306
    305307    /* Configure the bkpinfo structure, global file paths, etc. */
     
    548550        log_msg(10, "FYI, g_dvd_drive_is_here was never used");
    549551    }
    550     log_msg(0, "End date : %s", get_time());
     552
     553    /* finalize log file with time stamp */
     554    tcurr = time(NULL);
     555    log_msg(0, "Time finished: %s", ctime(&tcurr));
    551556
    552557    if (!g_text_mode) {
Note: See TracChangeset for help on using the changeset viewer.