about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/Makefile2
-rw-r--r--libio/fileops.c2
-rw-r--r--libio/genops.c4
-rw-r--r--libio/iofdopen.c4
-rw-r--r--libio/iofgetpos.c2
-rw-r--r--libio/iofsetpos.c2
-rw-r--r--libio/ioftell.c2
-rw-r--r--libio/iogetdelim.c4
-rw-r--r--libio/libioP.h2
9 files changed, 11 insertions, 13 deletions
diff --git a/libio/Makefile b/libio/Makefile
index 902d63f21c..ba64fc7752 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -36,6 +36,8 @@ routines	:=							      \
 									      \
 	libc_fatal
 
+all: # Make this the default target; it will be defined in Rules.
+
 include ../Makeconfig
 
 ifneq (,$(filter %REENTRANT, $(defines)))
diff --git a/libio/fileops.c b/libio/fileops.c
index a3138afd16..b4bd5ce7cd 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -165,7 +165,7 @@ DEFUN(_IO_file_fopen, (fp, filename, mode),
     read_write = _IO_NO_READS|_IO_IS_APPENDING;
     break;
   default:
-    errno = EINVAL;
+    __set_errno (EINVAL);
     return NULL;
   }
   if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+')) {
diff --git a/libio/genops.c b/libio/genops.c
index 818e740851..7c2dcba7b4 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -466,7 +466,7 @@ DEFUN(_IO_init, (fp, flags),
   fp->_markers = NULL;
   fp->_cur_column = 0;
 #ifdef _IO_MTSAFE_IO
-  __libc_lock_init (fp->_lock);
+  __libc_lock_init (*fp->_lock);
 #endif
 }
 
@@ -501,7 +501,7 @@ DEFUN(_IO_default_finish, (fp),
     }
 
 #ifdef _IO_MTSAFE_IO
-  __libc_lock_fini (fp->_lock);
+  __libc_lock_fini (*fp->_lock);
 #endif
 
   _IO_un_link(fp);
diff --git a/libio/iofdopen.c b/libio/iofdopen.c
index 797192eaae..67c629c583 100644
--- a/libio/iofdopen.c
+++ b/libio/iofdopen.c
@@ -61,9 +61,7 @@ _IO_fdopen (fd, mode)
       read_write = _IO_NO_READS|_IO_IS_APPENDING;
       break;
     default:
-#ifdef EINVAL
-      errno = EINVAL;
-#endif
+      MAYBE_SET_EINVAL;
       return NULL;
   }
   if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c
index c45cfacb06..4cec7a73d8 100644
--- a/libio/iofgetpos.c
+++ b/libio/iofgetpos.c
@@ -41,7 +41,7 @@ _IO_fgetpos (fp, posp)
     {
 #ifdef EIO
       if (errno == 0)
-	errno = EIO;
+	__set_errno (EIO);
 #endif
       return EOF;
     }
diff --git a/libio/iofsetpos.c b/libio/iofsetpos.c
index 96c3a7a2a0..9013606e72 100644
--- a/libio/iofsetpos.c
+++ b/libio/iofsetpos.c
@@ -39,7 +39,7 @@ _IO_fsetpos (fp, posp)
       /*ANSI explicily requires setting errno to a positive value on failure.*/
 #ifdef EIO
       if (errno == 0)
-	errno = EIO;
+	__set_errno (EIO);
 #endif
       result = EOF;
     }
diff --git a/libio/ioftell.c b/libio/ioftell.c
index 12b90b37f5..ec3b1a2f2e 100644
--- a/libio/ioftell.c
+++ b/libio/ioftell.c
@@ -40,7 +40,7 @@ _IO_ftell (fp)
     {
 #ifdef EIO
       if (errno == 0)
-	errno = EIO;
+	__set_errno (EIO);
 #endif
       return -1L;
     }
diff --git a/libio/iogetdelim.c b/libio/iogetdelim.c
index 0acd76e6c5..da6efa459a 100644
--- a/libio/iogetdelim.c
+++ b/libio/iogetdelim.c
@@ -48,9 +48,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
 
   if (lineptr == NULL || n == NULL)
     {
-#ifdef EINVAL
-      errno = EINVAL;
-#endif
+      MAYBE_SET_EINVAL;
       return -1;
     }
   CHECK_FILE (fp, -1);
diff --git a/libio/libioP.h b/libio/libioP.h
index f5e6dc5a0e..d3c871fbeb 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -397,7 +397,7 @@ extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
 #endif
 
 #ifdef EINVAL
-#define MAYBE_SET_EINVAL errno = EINVAL
+#define MAYBE_SET_EINVAL __set_errno (EINVAL)
 #else
 #define MAYBE_SET_EINVAL /* nothing */
 #endif