diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-09-07 05:09:22 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-09-07 05:09:22 +0000 |
commit | 3da6aa878aa23f19d0b928cce0c01f707229c48a (patch) | |
tree | 2cfc54fdb6011cd8ed9b00dac64b003fae934698 | |
parent | f522d1231c35f7fb69666ba80a7383ff7a3fa760 (diff) | |
download | busybox-w32-3da6aa878aa23f19d0b928cce0c01f707229c48a.tar.gz busybox-w32-3da6aa878aa23f19d0b928cce0c01f707229c48a.tar.bz2 busybox-w32-3da6aa878aa23f19d0b928cce0c01f707229c48a.zip |
adding files missed in prev updates (forgot about svn add)
-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 | } | ||