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/libbb/info_msg.c

    r1765 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 #include <syslog.h>
    1110#include "libbb.h"
     11#if ENABLE_FEATURE_SYSLOG
     12# include <syslog.h>
     13#endif
    1214
    13 void bb_info_msg(const char *s, ...)
     15void FAST_FUNC bb_info_msg(const char *s, ...)
    1416{
     17#ifdef THIS_ONE_DOESNT_DO_SINGLE_WRITE
    1518    va_list p;
    1619    /* va_copy is used because it is not portable
     
    2427        fputs(msg_eol, stdout);
    2528    }
    26     if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG))
     29# if ENABLE_FEATURE_SYSLOG
     30    if (logmode & LOGMODE_SYSLOG)
    2731        vsyslog(LOG_INFO, s, p2);
     32# endif
    2833    va_end(p2);
    2934    va_end(p);
     35#else
     36    int used;
     37    char *msg;
     38    va_list p;
     39
     40    if (logmode == 0)
     41        return;
     42
     43    va_start(p, s);
     44    used = vasprintf(&msg, s, p);
     45    va_end(p);
     46    if (used < 0)
     47        return;
     48
     49# if ENABLE_FEATURE_SYSLOG
     50    if (logmode & LOGMODE_SYSLOG)
     51        syslog(LOG_INFO, "%s", msg);
     52# endif
     53    if (logmode & LOGMODE_STDIO) {
     54        fflush_all();
     55        /* used = strlen(msg); - must be true already */
     56        msg[used++] = '\n';
     57        full_write(STDOUT_FILENO, msg, used);
     58    }
     59
     60    free(msg);
     61#endif
    3062}
Note: See TracChangeset for help on using the changeset viewer.