summaryrefslogtreecommitdiffstats
path: root/urunlevel/runlevel/log_failure_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'urunlevel/runlevel/log_failure_msg.c')
-rw-r--r--urunlevel/runlevel/log_failure_msg.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/urunlevel/runlevel/log_failure_msg.c b/urunlevel/runlevel/log_failure_msg.c
new file mode 100644
index 0000000..47f43f7
--- /dev/null
+++ b/urunlevel/runlevel/log_failure_msg.c
@@ -0,0 +1,54 @@
1/*
2 * Mini log_failure_msg implementation for busybox.
3 *
4 * Copyright (C) 2005 by David Seikel won_fang@yahoo.com.au
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 * 02111-1307 USA
20 *
21 */
22
23#include <unistd.h>
24
25#include "busybox.h"
26#include "lib_init_d.h"
27
28
29void log_failure_msg(char *message)
30{
31 bb_perror_msg("Failure - %s\n", message);
32}
33
34
35/*
36log_failure_msg "message"
37 This requests the distribution to print a failure
38 message. The message should be relatively short; no
39 more than 60 characters is highly desirable.
40*/
41
42int log_failure_msg_main(int argc, char **argv)
43{
44 char *message = argv_cat(argc, argv);
45
46 if (message != NULL)
47 {
48 log_failure_msg(message);
49
50 free(message);
51 return EXIT_SUCCESS;
52 }
53 return EXIT_FAILURE;
54}