Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/sysklogd/klogd.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/sysklogd/klogd.c

    r2859 r3232  
    1717 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    1818 */
     19
     20//usage:#define klogd_trivial_usage
     21//usage:       "[-c N] [-n]"
     22//usage:#define klogd_full_usage "\n\n"
     23//usage:       "Kernel logger\n"
     24//usage:     "\n    -c N    Print to console messages more urgent than prio N (1-8)"
     25//usage:     "\n    -n  Run in foreground"
    1926
    2027#include "libbb.h"
     
    189196    syslog(LOG_NOTICE, "klogd started: %s", bb_banner);
    190197
     198    write_pidfile(CONFIG_PID_FILE_PATH "/klogd.pid");
     199
    191200    used = 0;
    192201    while (!bb_got_signal) {
     
    232241            if (*start == '<') {
    233242                start++;
    234                 if (*start) {
    235                     /* kernel never generates multi-digit prios */
    236                     priority = (*start - '0');
    237                     start++;
    238                 }
     243                if (*start)
     244                    priority = strtoul(start, &start, 10);
    239245                if (*start == '>')
    240246                    start++;
     
    252258    klogd_close();
    253259    syslog(LOG_NOTICE, "klogd: exiting");
     260    remove_pidfile(CONFIG_PID_FILE_PATH "/klogd.pid");
    254261    if (bb_got_signal)
    255262        kill_myself_with_sig(bb_got_signal);
Note: See TracChangeset for help on using the changeset viewer.