• Richard M. Stallman's avatar
    Fix performance bug on hosts with large · b97771fc
    Richard M. Stallman authored
    /var/adm/wtmp files with no boot records.
    
    (boot_time_initialized): New var.
    (init_filelock): Initialize it.
    (get_boot_time): Use it, instead of nonzero boot_time,
    to test whether boot_time is initialized.
    Don't invoke utmp routines when dumping.
    
    (get_boot_time): First, try to get the boot time from the
    current utmp file, as this can be much faster.  Don't try to
    get the boot time from utmp and/or wtmp more than once.
    
    (get_boot_time_1): When passed null pointer, don't invoke utmpname.
    New arg LATEST.  All uses changed.
    b97771fc
filelock.c 18.8 KB