]> git.pld-linux.org Git - projects/rc-scripts.git/blame - src/loglevel.c
netfs: respect VSERVER_ISOLATION_NET here as well
[projects/rc-scripts.git] / src / loglevel.c
CommitLineData
cee18a41
AM
1
2/* Change the default console loglevel */
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <unistd.h>
7#include <linux/unistd.h>
8#include <sys/syscall.h>
9
10int main(int argc, char **argv) {
11 int level;
12
13 if (!argv[1]) exit(0);
14 level=atoi(argv[1]);
15 if ( (level<1) || (level>8) ) {
16 fprintf(stderr,"invalid log level %d\n",level);
17 exit(-1);
18 }
19 if (!syscall(SYS_syslog,8,NULL,level)) {
20 exit(0);
21 } else {
22 perror("syslog");
23 exit(-1);
24 }
25}
This page took 0.079146 seconds and 4 git commands to generate.