Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/sysklogd/logger.c

    r1772 r2725  
    55 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
     10/*
     11 * Done in syslogd_and_logger.c:
    1012#include "libbb.h"
    11 
    12 #if !defined CONFIG_SYSLOGD
    13 
    1413#define SYSLOG_NAMES
    15 #include <sys/syslog.h>
    16 
    17 #else
    18 #include <sys/syslog.h>
    19 #  ifndef __dietlibc__
    20     /* We have to do this since the header file defines static
    21      * structures.  Argh.... bad libc, bad, bad...
    22      */
    23     typedef struct _code {
    24         char *c_name;
    25         int c_val;
    26     } CODE;
    27     extern CODE prioritynames[];
    28     extern CODE facilitynames[];
    29 #  endif
    30 #endif
     14#define SYSLOG_NAMES_CONST
     15#include <syslog.h>
     16*/
    3117
    3218/* Decode a symbolic name to a numeric value
     
    3723 * Original copyright notice is retained at the end of this file.
    3824 */
    39 static int decode(char *name, CODE * codetab)
     25static int decode(char *name, const CODE *codetab)
    4026{
    41     CODE *c;
     27    const CODE *c;
    4228
    4329    if (isdigit(*name))
     
    8167}
    8268
     69#define strbuf bb_common_bufsiz1
    8370
    84 int logger_main(int argc, char **argv);
    85 int logger_main(int argc, char **argv)
     71int logger_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     72int logger_main(int argc UNUSED_PARAM, char **argv)
    8673{
    8774    char *str_p, *str_t;
     75    int opt;
    8876    int i = 0;
    89     char name[80];
    9077
    9178    /* Fill out the name string early (may be overwritten later) */
    92     bb_getpwuid(name, sizeof(name), geteuid());
    93     str_t = name;
     79    str_t = uid2uname_utoa(geteuid());
    9480
    9581    /* Parse any options */
    96     getopt32(argv, "p:st:", &str_p, &str_t);
     82    opt = getopt32(argv, "p:st:", &str_p, &str_t);
    9783
    98     if (option_mask32 & 0x2) /* -s */
     84    if (opt & 0x2) /* -s */
    9985        i |= LOG_PERROR;
    100     //if (option_mask32 & 0x4) /* -t */
     86    //if (opt & 0x4) /* -t */
    10187    openlog(str_t, i, 0);
    10288    i = LOG_USER | LOG_NOTICE;
    103     if (option_mask32 & 0x1) /* -p */
     89    if (opt & 0x1) /* -p */
    10490        i = pencode(str_p);
    10591
    106     argc -= optind;
    10792    argv += optind;
    108     if (!argc) {
    109 #define strbuf bb_common_bufsiz1
     93    if (!argv[0]) {
    11094        while (fgets(strbuf, COMMON_BUFSIZE, stdin)) {
    11195            if (strbuf[0]
     
    133117}
    134118
     119/* Clean up. Needed because we are included from syslogd_and_logger.c */
     120#undef strbuf
    135121
    136122/*-
    137123 * Copyright (c) 1983, 1993
    138  *  The Regents of the University of California.  All rights reserved.
     124 * The Regents of the University of California.  All rights reserved.
    139125 *
    140126 * This is the original license statement for the decode and pencode functions.
     
    149135 *    documentation and/or other materials provided with the distribution.
    150136 *
    151  * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
    152  *      ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
     137 * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
     138 *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
    153139 *
    154140 * 4. Neither the name of the University nor the names of its contributors
Note: See TracChangeset for help on using the changeset viewer.