Move all custom banner() handling to configure script.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-06-17 13:36:36 +02:00
1 parent 195f17ae08
commit 231539cd7d
2 files changed
+8 -9

No files matched your search

Vendored
+3 -2
View File
@@ -13,6 +13,7 @@
# Setup defaults if undefined # Setup defaults if undefined
defaults() defaults()
{ {
heading=${heading:='"Finit v" VERSION'}
prefix=${prefix:="/usr"} prefix=${prefix:="/usr"}
sysconfdir=${sysconfdir:="/etc"} sysconfdir=${sysconfdir:="/etc"}
sbindir=${sbindir:="/sbin"} sbindir=${sbindir:="/sbin"}
@@ -166,7 +167,7 @@ while [ "$*" != "" ]; do
;; ;;
with-heading) with-heading)
heading="$arg" heading="\"$arg\""
;; ;;
with-plugins) with-plugins)
@@ -282,7 +283,7 @@ if [ $inetd -eq 0 ]; then
fi fi
if [ x"$heading" != x"" ]; then if [ x"$heading" != x"" ]; then
echo "#define INIT_HEADING \"$heading\"" >> config.h echo "#define INIT_HEADING $heading" >> config.h
fi fi
echo "#define VERBOSE_MODE $verbose" >> config.h echo "#define VERBOSE_MODE $verbose" >> config.h
+5 -7
View File
@@ -55,16 +55,14 @@ uev_ctx_t *ctx = NULL; /* Main loop context */
static int banner(void) static int banner(void)
{ {
char buf[42] = INIT_HEADING;
const char separator[] = "========================================================================";
if (!verbose) if (!verbose)
return 0; return 0;
delline(); fprintf(stderr, "\e[2K\e[1m%s %.*s\e[0m\n", buf, 66 - (int)strlen(buf), separator);
#ifdef INIT_HEADING
echo("%s", INIT_HEADING);
#else
echo("Finit v" VERSION);
echo("===================================================================");
#endif
return 0; return 0;
} }