]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include termios.h.
authorJim Meyering <jim@meyering.net>
Mon, 8 Jul 1996 04:19:36 +0000 (04:19 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 8 Jul 1996 04:19:36 +0000 (04:19 +0000)
Guard inclusion of sys/ioctl.h with #ifdef GWINSZ_IN_SYS_IOCTL,
rather than HAVE_SYS_IOCTL_H.  Modelled after sh-utils' stty.c
at suggestion from Chip Bennett <BennettC@j64.stratcom.af.mil>.

src/ls.c

index 2d5ec3500b3aa06419ba74974f3c1504a97b5828..0b72a3d2a0a87430e4008f214511c66114986ba5 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -43,7 +43,8 @@
 #include <config.h>
 #include <sys/types.h>
 
-#if HAVE_SYS_IOCTL_H
+#include <termios.h>
+#ifdef GWINSZ_IN_SYS_IOCTL
 # include <sys/ioctl.h>
 #endif
 
@@ -129,24 +130,6 @@ struct bin_str
     char *string;              /* Pointer to the same */
   };
 
-struct bin_str color_indicator[] =
-  {
-    { LEN_STR_PAIR ("\033[") },                /* lc: Left of color sequence */
-    { LEN_STR_PAIR ("m") },            /* rc: Right of color sequence */
-    { 0, NULL },                       /* ec: End color (replaces lc+no+rc) */
-    { LEN_STR_PAIR ("0") },            /* no: Normal */
-    { LEN_STR_PAIR ("0") },            /* fi: File: default */
-    { LEN_STR_PAIR ("32") },           /* di: Directory: green */
-    { LEN_STR_PAIR ("36") },           /* ln: Symlink: cyan */
-    { LEN_STR_PAIR ("31") },           /* pi: Pipe: red */
-    { LEN_STR_PAIR ("33") },           /* so: Socket: yellow/brown */
-    { LEN_STR_PAIR ("44;37") },                /* bd: Block device: white on blue */
-    { LEN_STR_PAIR ("44;37") },                /* cd: Char device: white on blue */
-    { 0, NULL },                       /* mi: Missing file: undefined */
-    { 0, NULL },                       /* or: Orphanned symlink: undefined */
-    { LEN_STR_PAIR ("35") }            /* ex: Executable: purple */
-  };
-
 #ifndef STDC_HEADERS
 char *ctime ();
 time_t time ();
@@ -392,6 +375,24 @@ struct col_ext_type
     struct col_ext_type *next; /* Next in list */
   };
 
+static struct bin_str color_indicator[] =
+  {
+    { LEN_STR_PAIR ("\033[") },                /* lc: Left of color sequence */
+    { LEN_STR_PAIR ("m") },            /* rc: Right of color sequence */
+    { 0, NULL },                       /* ec: End color (replaces lc+no+rc) */
+    { LEN_STR_PAIR ("0") },            /* no: Normal */
+    { LEN_STR_PAIR ("0") },            /* fi: File: default */
+    { LEN_STR_PAIR ("32") },           /* di: Directory: green */
+    { LEN_STR_PAIR ("36") },           /* ln: Symlink: cyan */
+    { LEN_STR_PAIR ("31") },           /* pi: Pipe: red */
+    { LEN_STR_PAIR ("33") },           /* so: Socket: yellow/brown */
+    { LEN_STR_PAIR ("44;37") },                /* bd: Block device: white on blue */
+    { LEN_STR_PAIR ("44;37") },                /* cd: Char device: white on blue */
+    { 0, NULL },                       /* mi: Missing file: undefined */
+    { 0, NULL },                       /* or: Orphanned symlink: undefined */
+    { LEN_STR_PAIR ("35") }            /* ex: Executable: purple */
+  };
+
 /* FIXME: comment  */
 struct col_ext_type *col_ext_list = NULL;