diff options
| author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-09-07 05:09:22 +0000 |
|---|---|---|
| committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-09-07 05:09:22 +0000 |
| commit | bc71024479a3658792af3e68245f06b11cef048e (patch) | |
| tree | 2cfc54fdb6011cd8ed9b00dac64b003fae934698 | |
| parent | b6e19e00ced66a0c2b6d63dc05464dc4c11a4c46 (diff) | |
| download | busybox-w32-bc71024479a3658792af3e68245f06b11cef048e.tar.gz busybox-w32-bc71024479a3658792af3e68245f06b11cef048e.tar.bz2 busybox-w32-bc71024479a3658792af3e68245f06b11cef048e.zip | |
adding files missed in prev updates (forgot about svn add)
git-svn-id: svn://busybox.net/trunk/busybox@16061 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | libbb/info_msg.c | 23 | ||||
| -rw-r--r-- | libbb/vinfo_msg.c | 30 |
2 files changed, 53 insertions, 0 deletions
diff --git a/libbb/info_msg.c b/libbb/info_msg.c new file mode 100644 index 000000000..78d5c8f32 --- /dev/null +++ b/libbb/info_msg.c | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | ||
| 2 | /* | ||
| 3 | * Utility routines. | ||
| 4 | * | ||
| 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | ||
| 6 | * | ||
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <stdio.h> | ||
| 11 | #include <errno.h> | ||
| 12 | #include <string.h> | ||
| 13 | #include <stdlib.h> | ||
| 14 | #include "libbb.h" | ||
| 15 | |||
| 16 | void bb_info_msg(const char *s, ...) | ||
| 17 | { | ||
| 18 | va_list p; | ||
| 19 | |||
| 20 | va_start(p, s); | ||
| 21 | bb_vinfo_msg(s, p); | ||
| 22 | va_end(p); | ||
| 23 | } | ||
diff --git a/libbb/vinfo_msg.c b/libbb/vinfo_msg.c new file mode 100644 index 000000000..e8776e5f4 --- /dev/null +++ b/libbb/vinfo_msg.c | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | ||
| 2 | /* | ||
| 3 | * Utility routines. | ||
| 4 | * | ||
| 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> | ||
| 6 | * | ||
| 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <stdio.h> | ||
| 11 | #include <errno.h> | ||
| 12 | #include <string.h> | ||
| 13 | #include <stdlib.h> | ||
| 14 | #include <syslog.h> | ||
| 15 | #include "libbb.h" | ||
| 16 | |||
| 17 | void bb_vinfo_msg(const char *s, va_list p) | ||
| 18 | { | ||
| 19 | /* va_copy is used because it is not portable | ||
| 20 | * to use va_list p twice */ | ||
| 21 | va_list p2; | ||
| 22 | va_copy(p2, p); | ||
| 23 | if (logmode & LOGMODE_STDIO) { | ||
| 24 | vprintf(s, p); | ||
| 25 | putchar('\n'); | ||
| 26 | } | ||
| 27 | if (logmode & LOGMODE_SYSLOG) | ||
| 28 | vsyslog(LOG_INFO, s, p2); | ||
| 29 | va_end(p2); | ||
| 30 | } | ||
