aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-09-07 16:20:03 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-09-07 16:20:03 +0000
commitab24234b35e47e3d44b6fcda07d75a763dc2b33b (patch)
treef85bbdf6cb572751dee639feb9896cad3503b924 /libbb
parent309147b2fe10e10c52e8bcec8ba83546c198e320 (diff)
downloadbusybox-w32-ab24234b35e47e3d44b6fcda07d75a763dc2b33b.tar.gz
busybox-w32-ab24234b35e47e3d44b6fcda07d75a763dc2b33b.tar.bz2
busybox-w32-ab24234b35e47e3d44b6fcda07d75a763dc2b33b.zip
getty, sulogin: convert to using bb_msg for syslog output
git-svn-id: svn://busybox.net/trunk/busybox@16065 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/error_msg_and_die.c4
-rw-r--r--libbb/fflush_stdout_and_exit.c2
-rw-r--r--libbb/herror_msg_and_die.c2
-rw-r--r--libbb/perror_msg_and_die.c2
-rw-r--r--libbb/verror_msg.c5
-rw-r--r--libbb/vinfo_msg.c2
-rw-r--r--libbb/warn_ignoring_args.c2
-rw-r--r--libbb/xfuncs.c3
8 files changed, 17 insertions, 5 deletions
diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c
index f25a1da32..29a260bde 100644
--- a/libbb/error_msg_and_die.c
+++ b/libbb/error_msg_and_die.c
@@ -13,6 +13,8 @@
13#include <stdlib.h> 13#include <stdlib.h>
14#include "libbb.h" 14#include "libbb.h"
15 15
16int die_sleep;
17
16void bb_error_msg_and_die(const char *s, ...) 18void bb_error_msg_and_die(const char *s, ...)
17{ 19{
18 va_list p; 20 va_list p;
@@ -20,5 +22,7 @@ void bb_error_msg_and_die(const char *s, ...)
20 va_start(p, s); 22 va_start(p, s);
21 bb_verror_msg(s, p, NULL); 23 bb_verror_msg(s, p, NULL);
22 va_end(p); 24 va_end(p);
25 if (die_sleep)
26 sleep(die_sleep);
23 exit(bb_default_error_retval); 27 exit(bb_default_error_retval);
24} 28}
diff --git a/libbb/fflush_stdout_and_exit.c b/libbb/fflush_stdout_and_exit.c
index 7e8152dd6..245f50864 100644
--- a/libbb/fflush_stdout_and_exit.c
+++ b/libbb/fflush_stdout_and_exit.c
@@ -20,5 +20,7 @@ void bb_fflush_stdout_and_exit(int retval)
20 if (fflush(stdout)) { 20 if (fflush(stdout)) {
21 retval = bb_default_error_retval; 21 retval = bb_default_error_retval;
22 } 22 }
23 if (die_sleep)
24 sleep(die_sleep);
23 exit(retval); 25 exit(retval);
24} 26}
diff --git a/libbb/herror_msg_and_die.c b/libbb/herror_msg_and_die.c
index 285b195ef..f115c8e0a 100644
--- a/libbb/herror_msg_and_die.c
+++ b/libbb/herror_msg_and_die.c
@@ -19,5 +19,7 @@ void bb_herror_msg_and_die(const char *s, ...)
19 va_start(p, s); 19 va_start(p, s);
20 bb_vherror_msg(s, p); 20 bb_vherror_msg(s, p);
21 va_end(p); 21 va_end(p);
22 if (die_sleep)
23 sleep(die_sleep);
22 exit(bb_default_error_retval); 24 exit(bb_default_error_retval);
23} 25}
diff --git a/libbb/perror_msg_and_die.c b/libbb/perror_msg_and_die.c
index 5b0464077..c1cfb956f 100644
--- a/libbb/perror_msg_and_die.c
+++ b/libbb/perror_msg_and_die.c
@@ -20,5 +20,7 @@ void bb_perror_msg_and_die(const char *s, ...)
20 va_start(p, s); 20 va_start(p, s);
21 bb_vperror_msg(s, p); 21 bb_vperror_msg(s, p);
22 va_end(p); 22 va_end(p);
23 if (die_sleep)
24 sleep(die_sleep);
23 exit(bb_default_error_retval); 25 exit(bb_default_error_retval);
24} 26}
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index d55da73ff..988a7a293 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -15,6 +15,7 @@
15#include "libbb.h" 15#include "libbb.h"
16 16
17int logmode = LOGMODE_STDIO; 17int logmode = LOGMODE_STDIO;
18const char *msg_eol = "\n";
18 19
19void bb_verror_msg(const char *s, va_list p, const char* strerr) 20void bb_verror_msg(const char *s, va_list p, const char* strerr)
20{ 21{
@@ -28,9 +29,9 @@ void bb_verror_msg(const char *s, va_list p, const char* strerr)
28 fprintf(stderr, "%s: ", bb_applet_name); 29 fprintf(stderr, "%s: ", bb_applet_name);
29 vfprintf(stderr, s, p); 30 vfprintf(stderr, s, p);
30 if (!strerr) 31 if (!strerr)
31 fputc('\n', stderr); 32 fputs(msg_eol, stderr);
32 else 33 else
33 fprintf(stderr, ": %s\n", strerr); 34 fprintf(stderr, ": %s%s", strerr, msg_eol);
34 } 35 }
35 if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG)) { 36 if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG)) {
36 if (!strerr) 37 if (!strerr)
diff --git a/libbb/vinfo_msg.c b/libbb/vinfo_msg.c
index 82fbda221..613b013cd 100644
--- a/libbb/vinfo_msg.c
+++ b/libbb/vinfo_msg.c
@@ -22,7 +22,7 @@ void bb_vinfo_msg(const char *s, va_list p)
22 va_copy(p2, p); 22 va_copy(p2, p);
23 if (logmode & LOGMODE_STDIO) { 23 if (logmode & LOGMODE_STDIO) {
24 vprintf(s, p); 24 vprintf(s, p);
25 putchar('\n'); 25 fputs(msg_eol, stdout);
26 } 26 }
27 if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG)) 27 if (ENABLE_FEATURE_SYSLOG && (logmode & LOGMODE_SYSLOG))
28 vsyslog(LOG_INFO, s, p2); 28 vsyslog(LOG_INFO, s, p2);
diff --git a/libbb/warn_ignoring_args.c b/libbb/warn_ignoring_args.c
index af82a6b5b..6405ff826 100644
--- a/libbb/warn_ignoring_args.c
+++ b/libbb/warn_ignoring_args.c
@@ -12,6 +12,6 @@
12void bb_warn_ignoring_args(int n) 12void bb_warn_ignoring_args(int n)
13{ 13{
14 if (n) { 14 if (n) {
15 bb_perror_msg("ignoring all arguments"); 15 bb_error_msg("ignoring all arguments");
16 } 16 }
17} 17}
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 435379de2..4bb05f248 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -408,7 +408,8 @@ char *xasprintf(const char *format, ...)
408void xprint_and_close_file(FILE *file) 408void xprint_and_close_file(FILE *file)
409{ 409{
410 // copyfd outputs error messages for us. 410 // copyfd outputs error messages for us.
411 if (bb_copyfd_eof(fileno(file), 1) == -1) exit(bb_default_error_retval); 411 if (bb_copyfd_eof(fileno(file), 1) == -1)
412 exit(bb_default_error_retval);
412 413
413 fclose(file); 414 fclose(file);
414} 415}