summaryrefslogtreecommitdiffstats
path: root/term-utils/setterm.c
diff options
context:
space:
mode:
authorSami Kerola2014-05-11 23:52:09 +0200
committerSami Kerola2014-05-19 22:56:24 +0200
commit104ecc7e701fcec340ccc76d15bfc855f7786ced (patch)
tree550a5269eed5331340368a00cde9fbb66928b882 /term-utils/setterm.c
parentmount: fix tiny typo in man page (diff)
downloadkernel-qcow2-util-linux-104ecc7e701fcec340ccc76d15bfc855f7786ced.tar.gz
kernel-qcow2-util-linux-104ecc7e701fcec340ccc76d15bfc855f7786ced.tar.xz
kernel-qcow2-util-linux-104ecc7e701fcec340ccc76d15bfc855f7786ced.zip
setterm: clean up includes
Use klogctl(2) from sys/klog.h just like dmesg(1). The rest is just reordering, and indenting. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/setterm.c')
-rw-r--r--term-utils/setterm.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 7a3131f5f..e6385ace6 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -92,48 +92,38 @@
* -store stores the terminal's current rendering options as the default
* values. */
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <termios.h>
#include <string.h>
-#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/klog.h>
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <sys/time.h>
+#include <termios.h>
+#include <unistd.h>
#ifndef NCURSES_CONST
-#define NCURSES_CONST const /* define before including term.h */
+# define NCURSES_CONST const /* define before including term.h */
#endif
#ifdef HAVE_NCURSES_H
-#include <ncurses.h>
+# include <ncurses.h>
#elif defined(HAVE_NCURSES_NCURSES_H)
-#include <ncurses/ncurses.h>
+# include <ncurses/ncurses.h>
#endif
/* must include after ncurses.h */
#include <term.h>
-#include <sys/param.h> /* for MAXPATHLEN */
-#include <sys/ioctl.h>
-#include <sys/time.h>
#ifdef HAVE_LINUX_TIOCL_H
-#include <linux/tiocl.h>
+# include <linux/tiocl.h>
#endif
#include "c.h"
-#include "xalloc.h"
-#include "nls.h"
#include "closestream.h"
-
-#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5
-#ifndef __alpha__
-# include <linux/unistd.h>
-#define __NR_klogctl __NR_syslog
-_syscall3(int, klogctl, int, type, char*, buf, int, len);
-#else /* __alpha__ */
-#define klogctl syslog
-#endif
-#endif
-extern int klogctl(int type, char *buf, int len);
+#include "nls.h"
+#include "xalloc.h"
/* Constants. */