diff options
Diffstat (limited to 'libio')
-rw-r--r-- | libio/Makefile | 2 | ||||
-rw-r--r-- | libio/fileops.c | 2 | ||||
-rw-r--r-- | libio/genops.c | 4 | ||||
-rw-r--r-- | libio/iofdopen.c | 4 | ||||
-rw-r--r-- | libio/iofgetpos.c | 2 | ||||
-rw-r--r-- | libio/iofsetpos.c | 2 | ||||
-rw-r--r-- | libio/ioftell.c | 2 | ||||
-rw-r--r-- | libio/iogetdelim.c | 4 | ||||
-rw-r--r-- | libio/libioP.h | 2 |
9 files changed, 11 insertions, 13 deletions
diff --git a/libio/Makefile b/libio/Makefile index 902d63f..ba64fc7 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 a3138af..b4bd5ce 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 818e740..7c2dcba 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 797192e..67c629c 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 c45cfac..4cec7a7 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 96c3a7a..9013606 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 12b90b3..ec3b1a2 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 0acd76e..da6efa4 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 f5e6dc5..d3c871f 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 |