about summary refs log tree commit diff
path: root/io
diff options
context:
space:
mode:
Diffstat (limited to 'io')
-rw-r--r--io/creat.c9
-rw-r--r--io/fts.c20
-rw-r--r--io/ftw.c16
-rw-r--r--io/getwd.c2
-rw-r--r--io/lockf.c6
5 files changed, 27 insertions, 26 deletions
diff --git a/io/creat.c b/io/creat.c
index ee935c87a4..1e1717b40b 100644
--- a/io/creat.c
+++ b/io/creat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <ansidecl.h>
 #include <fcntl.h>
 #include <sys/types.h>
 
@@ -24,7 +23,9 @@ Cambridge, MA 02139, USA.  */
 
 /* Create FILE with protections MODE.  */
 int
-DEFUN(creat, (file, mode), CONST char *file AND mode_t mode)
+creat (file, mode)
+     const char *file;
+     mode_t mode;
 {
-  return __open(file, O_WRONLY|O_CREAT|O_TRUNC, mode);
+  return __open (file, O_WRONLY|O_CREAT|O_TRUNC, mode);
 }
diff --git a/io/fts.c b/io/fts.c
index fe5750ab56..5e57eaf1b6 100644
--- a/io/fts.c
+++ b/io/fts.c
@@ -100,7 +100,7 @@ fts_open(argv, options, compar)
 
 	/* Options check. */
 	if (options & ~FTS_OPTIONMASK) {
-		errno = EINVAL;
+		__set_errno (EINVAL);
 		return (NULL);
 	}
 
@@ -134,7 +134,7 @@ fts_open(argv, options, compar)
 	for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) {
 		/* Don't allow zero-length paths. */
 		if ((len = strlen(*argv)) == 0) {
-			errno = ENOENT;
+			__set_errno (ENOENT);
 			goto mem3;
 		}
 
@@ -262,7 +262,7 @@ fts_close(sp)
 
 	/* Set errno and return. */
 	if (!ISSET(FTS_NOCHDIR) && saved_errno) {
-		errno = saved_errno;
+		__set_errno (saved_errno);
 		return (-1);
 	}
 	return (0);
@@ -425,7 +425,7 @@ name:		t = sp->fts_path + NAPPEND(p->fts_parent);
 		 * can distinguish between error and EOF.
 		 */
 		free(p);
-		errno = 0;
+		__set_errno (0);
 		return (sp->fts_cur = NULL);
 	}
 
@@ -446,7 +446,7 @@ name:		t = sp->fts_path + NAPPEND(p->fts_parent);
 		if (FCHDIR(sp, p->fts_symfd)) {
 			saved_errno = errno;
 			(void)close(p->fts_symfd);
-			errno = saved_errno;
+			__set_errno (saved_errno);
 			SET(FTS_STOP);
 			return (NULL);
 		}
@@ -476,7 +476,7 @@ fts_set(sp, p, instr)
 {
 	if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
 	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
-		errno = EINVAL;
+		__set_errno (EINVAL);
 		return (1);
 	}
 	p->fts_instr = instr;
@@ -492,7 +492,7 @@ fts_children(sp, instr)
 	int fd;
 
 	if (instr && instr != FTS_NAMEONLY) {
-		errno = EINVAL;
+		__set_errno (EINVAL);
 		return (NULL);
 	}
 
@@ -503,7 +503,7 @@ fts_children(sp, instr)
 	 * Errno set to 0 so user can distinguish empty directory from
 	 * an error.
 	 */
-	errno = 0;
+	__set_errno (0);
 
 	/* Fatal errors stop here. */
 	if (ISSET(FTS_STOP))
@@ -681,7 +681,7 @@ mem1:				saved_errno = errno;
 					free(p);
 				fts_lfree(head);
 				(void)closedir(dirp);
-				errno = saved_errno;
+				__set_errno (saved_errno);
 				cur->fts_info = FTS_ERR;
 				SET(FTS_STOP);
 				return (NULL);
@@ -803,7 +803,7 @@ fts_stat(sp, p, follow)
 		if (stat(p->fts_accpath, sbp)) {
 			saved_errno = errno;
 			if (!lstat(p->fts_accpath, sbp)) {
-				errno = 0;
+				__set_errno (0);
 				return (FTS_SLNONE);
 			}
 			p->fts_errno = saved_errno;
diff --git a/io/ftw.c b/io/ftw.c
index ff2e2b1fdc..b8d745b8d3 100644
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -47,7 +47,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
 
   got = 0;
 
-  errno = 0;
+  __set_errno (0);
 
   while ((entry = readdir (dirs[level])) != NULL)
     {
@@ -61,7 +61,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
 	  && (entry->d_name[1] == '\0' ||
 	      (entry->d_name[1] == '.' && entry->d_name[2] == '\0')))
 	{
-	  errno = 0;
+	  __set_errno (0);
 	  continue;
 	}
 
@@ -70,9 +70,9 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
       if (namlen + len + 1 > PATH_MAX)
 	{
 #ifdef ENAMETOOLONG
-	  errno = ENAMETOOLONG;
+	  __set_errno (ENAMETOOLONG);
 #else
-	  errno = ENOMEM;
+	  __set_errno (ENOMEM);
 #endif
 	  return -1;
 	}
@@ -120,7 +120,7 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
 
 	      save = errno;
 	      closedir (dirs[newlev]);
-	      errno = save;
+	      __set_errno (save);
 	      dirs[newlev] = NULL;
 	    }
 	}
@@ -139,13 +139,13 @@ DEFUN (ftw_dir, (dirs, level, descriptors, dir, len, func),
 	  skip = got;
 	  while (skip-- != 0)
 	    {
-	      errno = 0;
+	      __set_errno (0);
 	      if (readdir (dirs[level]) == NULL)
 		return errno == 0 ? 0 : -1;
 	    }
 	}
 
-      errno = 0;
+      __set_errno (0);
     }
 
   return errno == 0 ? 0 : -1;
@@ -211,7 +211,7 @@ DEFUN(ftw, (dir, func, descriptors),
 
 	  save = errno;
 	  closedir (dirs[0]);
-	  errno = save;
+	  __set_errno (save);
 	}
     }
 
diff --git a/io/getwd.c b/io/getwd.c
index 8a8d01a28e..00825ee0b0 100644
--- a/io/getwd.c
+++ b/io/getwd.c
@@ -37,7 +37,7 @@ getwd (buf)
 
   if (buf == NULL)
     {
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return NULL;
     }
 
diff --git a/io/lockf.c b/io/lockf.c
index 91664197ae..c391243e97 100644
--- a/io/lockf.c
+++ b/io/lockf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -37,7 +37,7 @@ lockf (int fd, int cmd, off_t len)
 	return -1;
       if (fl.l_type == F_UNLCK || fl.l_pid == getpid ())
 	return 0;
-      errno = EACCES;
+      __set_errno (EACCES);
       return -1;
 
     case F_ULOCK:
@@ -54,7 +54,7 @@ lockf (int fd, int cmd, off_t len)
       break;
 
     default:
-      errno = EINVAL;
+      __set_errno (EINVAL);
       return -1;
     }