]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
setterm: clean up includes
authorSami Kerola <kerolasa@iki.fi>
Sun, 11 May 2014 21:52:09 +0000 (22:52 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 19 May 2014 20:56:24 +0000 (21:56 +0100)
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>
term-utils/setterm.c

index 7a3131f5fc8b694d1b42513e3bc20d521851def5..e6385ace6e2fff62189b9eb997ace828b25ac824 100644 (file)
  *   -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. */