.
authorJim Meyering <jim@meyering.net>
Fri, 19 Aug 1994 17:01:45 +0000 (17:01 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 19 Aug 1994 17:01:45 +0000 (17:01 +0000)
lib/ftruncate.c

index 04156b76db7232ed57c6ff05d017e53ed2894ff2..4f6aaa99349e83b6059d79bd9620236d46e97fc4 100644 (file)
 #include <sys/types.h>
 #include <fcntl.h>
 
-#include <errno.h>
-#ifndef STDC_HEADERS
-extern int errno;
-#endif
-
 #ifdef F_CHSIZE
 
 int
@@ -36,10 +31,8 @@ ftruncate (fd, length)
 /* By William Kucharski <kucharsk@netcom.com>.  */
 
 #include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
+#include <errno.h>
 #include <unistd.h>
-#endif
 
 int
 ftruncate (fd, length)
@@ -96,6 +89,11 @@ ftruncate (fd, length)
 
 #else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
 
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+
 int
 ftruncate (fd, length)
      int fd;