forked from bitstreamout/showconsole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blogger.c
57 lines (49 loc) · 1 KB
/
blogger.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* blogger.c
*
* Copyright 2000 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany.
*
* This source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "libblogger.h"
int main(int argc, char * argv[])
{
int c, lvl = 'n';
while ((c = getopt(argc, argv, "ndfsu")) != -1) {
switch (c) {
case B_NOTICE:
case B_DONE:
case B_FAILED:
case B_SKIPPED:
case B_UNUSED:
lvl = c;
break;
case '?':
default:
lvl = B_NOTICE;
break;
}
}
argv += optind;
argc -= optind;
if (!argc)
exit(0);
c = argc;
if (bootlog(lvl, argv[0]) < 0)
exit(0);
argv++;
argc--;
for (c = 0; c < argc; c++)
bootlog(-1, " %s", argv[c]);
bootlog(-1, "\n");
return 0;
}