Re: coreutils-5.2.1. touch check fails as / is writable on OS X

2005-07-08 Thread Paul Eggert
Thanks for reporting that.  I think the bug was fixed in coreutils CVS
as follows:

2005-05-10  Jim Meyering  [EMAIL PROTECTED]

* tests/touch/not-owner: Skip this test if the user running it
owns `/' or has write access to it.

--- not-owner   23 Jun 2004 15:07:05 -  1.3
+++ not-owner   10 May 2005 13:30:39 -  1.5
@@ -11,6 +11,17 @@ fi
 . $srcdir/../lang-default
 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
 
+test=../../src/test
+if $test -w /; then
+  echo Skipping because you have write access to /.
+  (exit 77); exit 77
+fi
+
+if $test -O / || $test -G /; then
+  echo Skipping because you own /.
+  (exit 77); exit 77
+fi
+
 pwd=`pwd`
 t0=`echo $0|sed 's,.*/,,'`.tmp; tmp=$t0/$$
 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0  exit $status' 0


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: same.c:78: error: `HAVE_LONG_FILE_NAMES' undeclared (first use in this function)

2005-07-08 Thread Paul Eggert
Gerrit P. Haase [EMAIL PROTECTED] writes:

 I also got antoher error, for module mathl this was added to Makefile.am:

 noinst_HEADERS += 

 Since it was the first use of noinst_HEADERS automake chokes on it.

I guess you're supposed to put noinst_HEADERS = at the top.


 Suggested fix is adding

AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])

 to the same prerequisites like it is in backupfile.m4.

Thanks; I installed this patch in both gnulib and coreutils:

2005-07-07  Paul Eggert  [EMAIL PROTECTED]

* backupfile.m4 (gl_BACKUPFILE): Use AC_CHECK_FUNCS_ONCE on pathconf.
* same.m4 (gl_SAME): Likewise.
Require AC_SYS_LONG_FILE_NAMES; bug reported by Gerrit P. Haase.

Index: m4/backupfile.m4
===
RCS file: /cvsroot/gnulib/gnulib/m4/backupfile.m4,v
retrieving revision 1.8
diff -p -u -r1.8 backupfile.m4
--- m4/backupfile.m421 Mar 2005 22:06:27 -  1.8
+++ m4/backupfile.m48 Jul 2005 06:48:17 -
@@ -1,4 +1,4 @@
-# backupfile.m4 serial 7
+# backupfile.m4 serial 8
 dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,6 @@ AC_DEFUN([gl_BACKUPFILE],
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
   AC_REQUIRE([gl_AC_DOS])
   AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
-  AC_CHECK_HEADERS_ONCE(unistd.h)
-  AC_CHECK_FUNCS(pathconf)
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CHECK_FUNCS_ONCE([pathconf])
 ])
Index: m4/same.m4
===
RCS file: /cvsroot/gnulib/gnulib/m4/same.m4,v
retrieving revision 1.5
diff -p -u -r1.5 same.m4
--- m4/same.m4  21 Mar 2005 22:06:27 -  1.5
+++ m4/same.m4  8 Jul 2005 06:48:17 -
@@ -1,4 +1,4 @@
-# same.m4 serial 4
+# same.m4 serial 5
 dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,7 @@ AC_DEFUN([gl_SAME],
   AC_LIBOBJ([same])
 
   dnl Prerequisites of lib/same.c.
-  AC_CHECK_HEADERS_ONCE(unistd.h)
-  AC_CHECK_FUNCS(pathconf)
+  AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CHECK_FUNCS_ONCE([pathconf])
 ])




___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: switched coreutils to new regex implementation

2005-07-08 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Paul Eggert on 7/7/2005 6:32 PM:
 I installed the following to sync coreutils from gnulib with respect
 to regex.  This is a big patch, so I won't enclose the stuff that's
 identical to yesterday's gnulib patch.

gcc 3.4.4 emits these warnings on cygwin, when no -W flags are present.

In file included from regex.c:86:
regcomp.c: In function `init_dfa':
regcomp.c:921: warning: comparison is always true due to limited range of
data type
regcomp.c: In function `build_range_exp':
regcomp.c:2698: warning: comparison is always false due to limited range
of data type
regcomp.c:2698: warning: comparison is always false due to limited range
of data type

Cygwin defines WEOF to ((wint_t)-1), with sizeof(wchar_t) is 2 and
sizeof(wint_t) is 4.  That means a wchar_t will never equal WEOF.

Hmm, when working on this patch, the Makefile does not have a dependency
of lib/libcoreutils.a on the changes to lib/regcomp.c.  I also noticed
that I have both coreutils/lib/.deps/ and coreutils/lib/lib/.deps, if that
matters any.  I'm not sure what the correct patch here would be, my
workaround to test the patch was just deleting lib/reg*.o.

2005-07-08  Eric Blake  [EMAIL PROTECTED]  (tiny change)

* regcomp.c (init_dfa, build_range_exp): Store __btowc value
in wint_t, not wchar_t.

Index: lib/regcomp.c
===
RCS file: /cvsroot/coreutils/coreutils/lib/regcomp.c,v
retrieving revision 1.1
diff -u -p -r1.1 regcomp.c
- --- lib/regcomp.c   8 Jul 2005 00:23:16 -   1.1
+++ lib/regcomp.c   8 Jul 2005 12:05:49 -
@@ -917,7 +917,7 @@ init_dfa (dfa, pat_len)
  for (i = 0, ch = 0; i  BITSET_UINTS; ++i)
for (j = 0; j  UINT_BITS; ++j, ++ch)
  {
- -   wchar_t wch = __btowc (ch);
+   wint_t wch = __btowc (ch);
if (wch != WEOF)
  dfa-sb_char[i] |= 1  j;
 # ifndef _LIBC
@@ -2682,7 +2682,8 @@ build_range_exp (sbcset, start_elem, end

 # ifdef RE_ENABLE_I18N
   {
- -wchar_t wc, start_wc, end_wc;
+wchar_t wc;
+wint_t start_wc, end_wc;
 wchar_t cmp_buf[6] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'};

 start_ch = ((start_elem-type == SB_CHAR) ? start_elem-opr.ch

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCzmyG84KuGfSFAYARAn70AJ4ifNvPxJbMVyU3O5FbR7NK1mVCjQCcCWVv
TvzPe4CSeKJOfl3AqHW4MaQ=
=mPQW
-END PGP SIGNATURE-


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: same.c:78: error: `HAVE_LONG_FILE_NAMES' undeclared (first use in this function)

2005-07-08 Thread Gerrit P. Haase

Paul Eggert wrote:


Gerrit P. Haase [EMAIL PROTECTED] writes:



I also got antoher error, for module mathl this was added to Makefile.am:

noinst_HEADERS += 

Since it was the first use of noinst_HEADERS automake chokes on it.



I guess you're supposed to put noinst_HEADERS = at the top.



Yes.  I did this.  However, it should be done by gnulib-tool since it is
this script which creates the Makefile.am.


Gerrit


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: switched coreutils to new regex implementation

2005-07-08 Thread Paul Eggert
Eric Blake [EMAIL PROTECTED] writes:

 2005-07-08  Eric Blake  [EMAIL PROTECTED]  (tiny change)

   * regcomp.c (init_dfa, build_range_exp): Store __btowc value
   in wint_t, not wchar_t.

Thanks for reporting that.  I installed the following
(slightly-different) patch into gnulib (and coreutils), and filed a
bug report with glibc
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1057.

2005-07-08  Eric Blake  [EMAIL PROTECTED]  (tiny change)
   and  Paul Eggert  [EMAIL PROTECTED]

* config/srclist.txt: Comment out regcomp.c, since we have a porting fix
now.
* lib/regcomp.c (init_dfa, build_range_exp): Store __btowc value
in wint_t, not wchar_t.  Remove now-unnecessary cast.

Index: config/srclist.txt
===
RCS file: /cvsroot/gnulib/gnulib/config/srclist.txt,v
retrieving revision 1.65
diff -p -u -r1.65 srclist.txt
--- config/srclist.txt  7 Jul 2005 08:08:39 -   1.65
+++ config/srclist.txt  8 Jul 2005 17:43:55 -
@@ -93,11 +93,12 @@ $LIBCSRC/stdlib/getsubopt.c lib gpl
 #$LIBCSRC/posix/getopt.h   lib gpl (getopt_.h in gnulib)
 #$LIBCSRC/posix/getopt1.c  lib gpl
 #$LIBCSRC/posix/getopt_int.h   lib gpl
-$LIBCSRC/posix/regcomp.c   lib gpl
+# regcomp.c contains a porting fix
+#$LIBCSRC/posix/regcomp.c  lib gpl
 $LIBCSRC/posix/regex.c lib gpl
 $LIBCSRC/posix/regex.h lib gpl
 $LIBCSRC/posix/regex_internal.clib gpl
-# regex_internal.h contains a porting fix (glibc defines __mempcpy)
+# regex_internal.h contains a porting fix
 #$LIBCSRC/posix/regex_internal.h   lib gpl
 $LIBCSRC/posix/regexec.c   lib gpl
 # c89 changes $LIBCSRC/string/strdup.c lib gpl
Index: lib/regcomp.c
===
RCS file: /cvsroot/gnulib/gnulib/lib/regcomp.c,v
retrieving revision 1.1
diff -p -u -r1.1 regcomp.c
--- lib/regcomp.c   7 Jul 2005 08:08:39 -   1.1
+++ lib/regcomp.c   8 Jul 2005 17:43:55 -
@@ -917,11 +917,11 @@ init_dfa (dfa, pat_len)
  for (i = 0, ch = 0; i  BITSET_UINTS; ++i)
for (j = 0; j  UINT_BITS; ++j, ++ch)
  {
-   wchar_t wch = __btowc (ch);
+   wint_t wch = __btowc (ch);
if (wch != WEOF)
  dfa-sb_char[i] |= 1  j;
 # ifndef _LIBC
-   if (isascii (ch)  wch != (wchar_t) ch)
+   if (isascii (ch)  wch != ch)
  dfa-map_notascii = 1;
 # endif
  }
@@ -2682,7 +2682,8 @@ build_range_exp (sbcset, start_elem, end
 
 # ifdef RE_ENABLE_I18N
   {
-wchar_t wc, start_wc, end_wc;
+wchar_t wc;
+wint_t start_wc, end_wc;
 wchar_t cmp_buf[6] = {L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'};
 
 start_ch = ((start_elem-type == SB_CHAR) ? start_elem-opr.ch


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


more gcc warnings

2005-07-08 Thread Eric Blake
A couple of porting problems caught by compiling with gcc -Wall on cygwin:

ls.c and stty.c use ioctl without including sys/ioctl.h, triggering a
warning about implicit declarations.  Even worse, since ioctl is a varargs
function, this is undefined C (luckily, it compiles and links okay on cygwin).
I think the macros m4/jm-winsz[12].m4 are at fault here.  Cygwin has
TIOCGWINSZ only in termios.h; while ioctl is only in sys/ioctl.h (or
term.h, which includes sys/ioctl.h), so both headers are needed
before ioctl (STDOUT_FILENO, TIOCGWINSZ, ws) will compile without
warning.  This needs some autoconf magic (perhaps something that
defines IOCTL_IN_SYS_IOCTL), but I'm not sure of the best approach
for editing the existing m4 files.

id.c calls error (which ultimately gets to the printf family) with a format
%u for uid_t and gid_t.  I really don't know of any portable way to print
an id_t, except that POSIX guarantees that they must be integer types
(with no further limitations, such as unsigned or not exceeding long).  All
I could think of that won't truncate bits on some theoretical platform is
to cast to uintmax_t, which must work since they are integral.

2005-07-08  Eric Blake  [EMAIL PROTECTED]

* src/id.c (print_user, print_group): Cast uid_t/gid_t to
uintmax_t before passing to printf family as %ju.

Index: src/id.c
===
RCS file: /cvsroot/coreutils/coreutils/src/id.c,v
retrieving revision 1.85
diff -u -r1.85 id.c
--- src/id.c30 May 2005 07:33:00 -  1.85
+++ src/id.c8 Jul 2005 20:09:17 -
@@ -202,7 +202,8 @@
   pwd = getpwuid (uid);
   if (pwd == NULL)
{
- error (0, 0, _(cannot find name for user ID %u), uid);
+  error (0, 0, _(cannot find name for user ID %ju),
+ (uintmax_t) uid);
  ok = false;
}
 }
@@ -225,7 +226,8 @@
   grp = getgrgid (gid);
   if (grp == NULL)
{
- error (0, 0, _(cannot find name for group ID %u), gid);
+ error (0, 0, _(cannot find name for group ID %ju),
+ (uintmax_t) gid);
  ok = false;
}
 }

--
Eric Blake


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: more gcc warnings

2005-07-08 Thread Eric Blake
 [EMAIL PROTECTED] (Eric Blake) writes:
 
  ls.c and stty.c use ioctl without including sys/ioctl.h,
  triggering a warning about implicit declarations.  Even worse, since
  ioctl is a varargs function, this is undefined C (luckily, it
  compiles and links okay on cygwin).
 
 Thanks for reporting this.  POSIX says that stropt.h declares ioctl,
 so let's try including that instead.

POSIX spells it stropts.h (not stropt.h), and only on platforms that
support STREAMS.  Cygwin is not one of them, and has no stropts.h,
so your patch will not help cygwin.  Furthermore, cygwin's sys/ioctl.h
is pretty wimpy - it declares JUST ioctl and 3 #defines WINDOWS_*.  So
this part of the patch needs a total rework to fix your misspelling and to
still find a solution that supports cygwin.

 
  id.c calls error (which ultimately gets to the printf family) with a format
  %u for uid_t and gid_t.
 
 %lu should be good enough; id.c uses that elsewhere.  If we run into
 hosts where uid_t and gid_t are wider than long int, then we can worry
 about it later.  (Such hosts would not conform to pre-2001 POSIX.)

This part looked fine.

--
Eric Blake




___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: more gcc warnings

2005-07-08 Thread Paul Eggert
[EMAIL PROTECTED] (Eric Blake) writes:

 ls.c and stty.c use ioctl without including sys/ioctl.h,
 triggering a warning about implicit declarations.  Even worse, since
 ioctl is a varargs function, this is undefined C (luckily, it
 compiles and links okay on cygwin).

Thanks for reporting this.  POSIX says that stropt.h declares ioctl,
so let's try including that instead.

 id.c calls error (which ultimately gets to the printf family) with a format
 %u for uid_t and gid_t.

%lu should be good enough; id.c uses that elsewhere.  If we run into
hosts where uid_t and gid_t are wider than long int, then we can worry
about it later.  (Such hosts would not conform to pre-2001 POSIX.)

I installed this patch:

2005-07-08  Paul Eggert  [EMAIL PROTECTED]
 
Fix porting problems reported by Eric Blake.

* configure.ac: Add check for HAVE_FIONREAD_IN_SYS_IOCTL.
* m4/jm-macros.m4 (gl_CHECK_ALL_HEADERS): Check for stropt.h.
* src/cat.c, src/ls.c, src/stty.c: Include stropt.h if available,
because POSIX says that's where ioctl is declared.
* src/cat.c: Use HAVE_FIONREAD_IN_SYS_IOCTL instead of _POSIX_SOURCE
to decide whether to include sys/ioctl.h.

* src/id.c (print_user): Don't assume uid fits in unsigned int.
(print_group): Likewise, for gid.

Index: configure.ac
===
RCS file: /fetish/cu/configure.ac,v
retrieving revision 1.57
diff -p -u -r1.57 configure.ac
--- configure.ac18 May 2005 19:27:39 -  1.57
+++ configure.ac8 Jul 2005 22:49:47 -
@@ -244,6 +244,12 @@ if test $jm_cv_sys_tiocgwinsz_needs_term
[Define if your system defines TIOCGWINSZ in sys/pty.h.])
 fi
 
+# For src/cat.c.
+AC_CHECK_DECL([FIONREAD],
+  [AC_DEFINE([HAVE_FIONREAD_IN_SYS_IOCTL], 1,
+ [Define to 1 if sys/ioctl.h defines FIONREAD.])],
+  [], [#include sys/ioctl.h])
+
 # For src/kill.c.
 AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , ,
   [AC_INCLUDES_DEFAULT
Index: m4/jm-macros.m4
===
RCS file: /fetish/cu/m4/jm-macros.m4,v
retrieving revision 1.224
diff -p -u -r1.224 jm-macros.m4
--- m4/jm-macros.m4 3 Jul 2005 09:30:00 -   1.224
+++ m4/jm-macros.m4 8 Jul 2005 22:49:47 -
@@ -196,6 +196,7 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS],
 stdlib.h \
 stdint.h \
 string.h \
+stropt.h \
 sys/filsys.h \
 sys/fs/s5param.h \
 sys/fs_types.h \
Index: src/cat.c
===
RCS file: /fetish/cu/src/cat.c,v
retrieving revision 1.102
diff -p -u -r1.102 cat.c
--- src/cat.c   16 Jun 2005 21:40:43 -  1.102
+++ src/cat.c   8 Jul 2005 22:49:48 -
@@ -27,7 +27,10 @@
 #include stdio.h
 #include getopt.h
 #include sys/types.h
-#ifndef _POSIX_SOURCE
+#if HAVE_STROPT_H
+# include stropt.h
+#endif
+#if HAVE_FIONREAD_IN_SYS_IOCTL
 # include sys/ioctl.h
 #endif
 #include system.h
Index: src/id.c
===
RCS file: /fetish/cu/src/id.c,v
retrieving revision 1.85
diff -p -u -r1.85 id.c
--- src/id.c30 May 2005 07:33:00 -  1.85
+++ src/id.c8 Jul 2005 22:49:48 -
@@ -202,7 +202,8 @@ print_user (uid_t uid)
   pwd = getpwuid (uid);
   if (pwd == NULL)
{
- error (0, 0, _(cannot find name for user ID %u), uid);
+ error (0, 0, _(cannot find name for user ID %lu),
+(unsigned long int) uid);
  ok = false;
}
 }
@@ -225,7 +226,8 @@ print_group (gid_t gid)
   grp = getgrgid (gid);
   if (grp == NULL)
{
- error (0, 0, _(cannot find name for group ID %u), gid);
+ error (0, 0, _(cannot find name for group ID %lu),
+(unsigned long int) gid);
  ok = false;
}
 }
Index: src/ls.c
===
RCS file: /fetish/cu/src/ls.c,v
retrieving revision 1.392
diff -p -u -r1.392 ls.c
--- src/ls.c3 Jul 2005 09:31:19 -   1.392
+++ src/ls.c8 Jul 2005 22:49:48 -
@@ -60,6 +60,10 @@
 #include getopt.h
 #include signal.h
 
+#if HAVE_STROPT_H
+# include stropt.h
+#endif
+
 /* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is
present.  */
 #ifndef SA_NOCLDSTOP
Index: src/stty.c
===
RCS file: /fetish/cu/src/stty.c,v
retrieving revision 1.136
diff -p -u -r1.136 stty.c
--- src/stty.c  3 Jul 2005 07:21:03 -   1.136
+++ src/stty.c  8 Jul 2005 22:49:48 -
@@ -54,6 +54,10 @@
 #include getopt.h
 #include stdarg.h
 
+#if HAVE_STROPT_H
+# include stropt.h
+#endif
+
 #include system.h
 #include error.h
 #include fd-reopen.h


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: more gcc warnings

2005-07-08 Thread Paul Eggert
Does the following patch fix your problems with Cygwin?  (I haven't
had time to write a changelog entry for it.)  Most likely it won't
work on some older hosts, but we can cross that bridge if we come to
it.


Index: configure.ac
===
RCS file: /fetish/cu/configure.ac,v
retrieving revision 1.58
diff -p -u -r1.58 configure.ac
--- configure.ac8 Jul 2005 22:53:50 -   1.58
+++ configure.ac9 Jul 2005 00:09:22 -
@@ -50,7 +50,6 @@ AC_CHECK_FUNCS(gethostid,
 
 gl_MACROS
 
-AC_HEADER_TIOCGWINSZ()
 gl_WINSIZE_IN_PTEM
 
 AC_MSG_CHECKING(whether localtime caches TZ)
Index: m4/jm-macros.m4
===
RCS file: /fetish/cu/m4/jm-macros.m4,v
retrieving revision 1.225
diff -p -u -r1.225 jm-macros.m4
--- m4/jm-macros.m4 8 Jul 2005 22:56:17 -   1.225
+++ m4/jm-macros.m4 9 Jul 2005 00:09:22 -
@@ -196,7 +196,7 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS],
 stdlib.h \
 stdint.h \
 string.h \
-stropt.h \
+stropts.h \
 sys/filsys.h \
 sys/fs/s5param.h \
 sys/fs_types.h \
Index: src/cat.c
===
RCS file: /fetish/cu/src/cat.c,v
retrieving revision 1.103
diff -p -u -r1.103 cat.c
--- src/cat.c   8 Jul 2005 22:54:15 -   1.103
+++ src/cat.c   9 Jul 2005 00:09:23 -
@@ -27,12 +27,14 @@
 #include stdio.h
 #include getopt.h
 #include sys/types.h
-#if HAVE_STROPT_H
-# include stropt.h
+
+#if HAVE_STROPTS_H
+# include stropts.h
 #endif
-#if HAVE_FIONREAD_IN_SYS_IOCTL
+#if HAVE_SYS_IOCTL_H
 # include sys/ioctl.h
 #endif
+
 #include system.h
 #include error.h
 #include full-write.h
Index: src/ls.c
===
RCS file: /fetish/cu/src/ls.c,v
retrieving revision 1.393
diff -p -u -r1.393 ls.c
--- src/ls.c8 Jul 2005 22:54:40 -   1.393
+++ src/ls.c9 Jul 2005 00:09:23 -
@@ -42,8 +42,10 @@
 #if HAVE_TERMIOS_H
 # include termios.h
 #endif
-
-#ifdef GWINSZ_IN_SYS_IOCTL
+#if HAVE_STROPTS_H
+# include stropts.h
+#endif
+#if HAVE_SYS_IOCTL_H
 # include sys/ioctl.h
 #endif
 
@@ -60,10 +62,6 @@
 #include getopt.h
 #include signal.h
 
-#if HAVE_STROPT_H
-# include stropt.h
-#endif
-
 /* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is
present.  */
 #ifndef SA_NOCLDSTOP
Index: src/stty.c
===
RCS file: /fetish/cu/src/stty.c,v
retrieving revision 1.137
diff -p -u -r1.137 stty.c
--- src/stty.c  8 Jul 2005 22:54:40 -   1.137
+++ src/stty.c  9 Jul 2005 00:09:23 -
@@ -36,28 +36,28 @@
 
 #include stdio.h
 #include sys/types.h
+
 #if HAVE_TERMIOS_H
 # include termios.h
 #endif
-#ifdef GWINSZ_IN_SYS_IOCTL
+#if HAVE_STROPTS_H
+# include stropts.h
+#endif
+#ifdef HAVE_SYS_IOCTL_H
 # include sys/ioctl.h
 #endif
+
 #ifdef WINSIZE_IN_PTEM
 # include sys/stream.h
 # include sys/ptem.h
 #endif
 #ifdef GWINSZ_IN_SYS_PTY
-# include sys/ioctl.h
 # include sys/tty.h
 # include sys/pty.h
 #endif
 #include getopt.h
 #include stdarg.h
 
-#if HAVE_STROPT_H
-# include stropt.h
-#endif
-
 #include system.h
 #include error.h
 #include fd-reopen.h



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils