aboutsummaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/fgetc.c5
-rw-r--r--libio/fileops.c3
-rw-r--r--libio/fputc.c5
-rw-r--r--libio/freopen.c3
-rw-r--r--libio/freopen64.c5
-rw-r--r--libio/fseek.c5
-rw-r--r--libio/fseeko.c5
-rw-r--r--libio/fseeko64.c5
-rw-r--r--libio/ftello.c5
-rw-r--r--libio/ftello64.c5
-rw-r--r--libio/getc.c5
-rw-r--r--libio/getchar.c7
-rw-r--r--libio/iofclose.c3
-rw-r--r--libio/iofflush.c5
-rw-r--r--libio/iofgetpos.c5
-rw-r--r--libio/iofgetpos64.c5
-rw-r--r--libio/iofgets.c5
-rw-r--r--libio/iofputs.c5
-rw-r--r--libio/iofread.c5
-rw-r--r--libio/iofsetpos.c5
-rw-r--r--libio/iofsetpos64.c5
-rw-r--r--libio/ioftell.c5
-rw-r--r--libio/iofwrite.c5
-rw-r--r--libio/iogetdelim.c5
-rw-r--r--libio/iogets.c5
-rw-r--r--libio/ioputs.c5
-rw-r--r--libio/ioseekoff.c5
-rw-r--r--libio/ioseekpos.c5
-rw-r--r--libio/iosetbuffer.c5
-rw-r--r--libio/iosetvbuf.c5
-rw-r--r--libio/ioungetc.c5
-rw-r--r--libio/iovsprintf.c5
-rw-r--r--libio/iovsscanf.c3
-rw-r--r--libio/oldfileops.c3
-rw-r--r--libio/oldiofclose.c5
-rw-r--r--libio/peekc.c5
-rw-r--r--libio/putc.c5
-rw-r--r--libio/putchar.c5
-rw-r--r--libio/rewind.c5
39 files changed, 109 insertions, 78 deletions
diff --git a/libio/fgetc.c b/libio/fgetc.c
index 174e60fa3f..094c5fe62f 100644
--- a/libio/fgetc.c
+++ b/libio/fgetc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -35,6 +35,7 @@ fgetc (fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_getc_unlocked (fp);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/fileops.c b/libio/fileops.c
index e5ffb245aa..1219abea5d 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -460,7 +460,8 @@ _IO_file_sync (fp)
fp->_offset = _IO_pos_BAD;
/* FIXME: Cleanup - can this be shared? */
/* setg(base(), ptr, ptr); */
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return retval;
}
diff --git a/libio/fputc.c b/libio/fputc.c
index 22cdfab9a8..3ec8b693e9 100644
--- a/libio/fputc.c
+++ b/libio/fputc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -36,6 +36,7 @@ fputc (c, fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_putc_unlocked (c, fp);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/freopen.c b/libio/freopen.c
index 0452e7e6bb..22f2434ecb 100644
--- a/libio/freopen.c
+++ b/libio/freopen.c
@@ -54,6 +54,7 @@ freopen (filename, mode, fp)
else
#endif
result = _IO_freopen (filename, mode, fp);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/freopen64.c b/libio/freopen64.c
index 78e994df46..c5216317a2 100644
--- a/libio/freopen64.c
+++ b/libio/freopen64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -40,7 +40,8 @@ freopen64 (filename, mode, fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_freopen64 (filename, mode, fp);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
#else
__set_errno (ENOSYS);
diff --git a/libio/fseek.c b/libio/fseek.c
index f2563d33f2..f9284574c7 100644
--- a/libio/fseek.c
+++ b/libio/fseek.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@ fseek (fp, offset, whence)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_fseek (fp, offset, whence);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/fseeko.c b/libio/fseeko.c
index 0ebdfa937e..1836047012 100644
--- a/libio/fseeko.c
+++ b/libio/fseeko.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@ fseeko (fp, offset, whence)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_fseek (fp, offset, whence);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/fseeko64.c b/libio/fseeko64.c
index 81c17b398c..55699ae938 100644
--- a/libio/fseeko64.c
+++ b/libio/fseeko64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -39,7 +39,8 @@ fseeko64 (fp, offset, whence)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_fseek (fp, offset, whence);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
#else
__set_errno (ENOSYS);
diff --git a/libio/ftello.c b/libio/ftello.c
index 7585eea9ec..662b954c54 100644
--- a/libio/ftello.c
+++ b/libio/ftello.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -37,7 +37,8 @@ ftello (fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
if (pos == _IO_pos_BAD)
{
#ifdef EIO
diff --git a/libio/ftello64.c b/libio/ftello64.c
index 886591dca9..96eeb184a4 100644
--- a/libio/ftello64.c
+++ b/libio/ftello64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -38,7 +38,8 @@ ftello64 (fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
if (pos == _IO_pos_BAD)
{
#ifdef EIO
diff --git a/libio/getc.c b/libio/getc.c
index 1dc53b5ed6..81a4b52c83 100644
--- a/libio/getc.c
+++ b/libio/getc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -37,7 +37,8 @@ _IO_getc (fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_getc_unlocked (fp);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/getchar.c b/libio/getchar.c
index 93194b3912..fdc2ec3a87 100644
--- a/libio/getchar.c
+++ b/libio/getchar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -33,8 +33,9 @@ getchar ()
{
int result;
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, stdin);
- _IO_flockfile (stdin);
+ _IO_flockfile (_IO_stdin);
result = _IO_getc_unlocked (stdin);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (_IO_stdin);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/iofclose.c b/libio/iofclose.c
index 7100425556..f896e09b7e 100644
--- a/libio/iofclose.c
+++ b/libio/iofclose.c
@@ -43,7 +43,8 @@ _IO_new_fclose (fp)
else
status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
_IO_FINISH (fp);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
{
fp->_IO_file_flags = 0;
diff --git a/libio/iofflush.c b/libio/iofflush.c
index 540c99d535..724ff26ac8 100644
--- a/libio/iofflush.c
+++ b/libio/iofflush.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -39,7 +39,8 @@ _IO_fflush (fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
result = _IO_SYNC (fp) ? EOF : 0;
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
}
diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c
index 6afc323136..5fed6c3685 100644
--- a/libio/iofgetpos.c
+++ b/libio/iofgetpos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -36,7 +36,8 @@ _IO_fgetpos (fp, posp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
if (pos == _IO_pos_BAD)
{
/* ANSI explicitly requires setting errno to a positive value on
diff --git a/libio/iofgetpos64.c b/libio/iofgetpos64.c
index 0cb79d6619..8a7733bfb5 100644
--- a/libio/iofgetpos64.c
+++ b/libio/iofgetpos64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -37,7 +37,8 @@ _IO_fgetpos64 (fp, posp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
if (pos == _IO_pos_BAD)
{
/* ANSI explicitly requires setting errno to a positive value on
diff --git a/libio/iofgets.c b/libio/iofgets.c
index 91db09f342..d61fb81481 100644
--- a/libio/iofgets.c
+++ b/libio/iofgets.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -54,7 +54,8 @@ _IO_fgets (buf, n, fp)
result = buf;
}
fp->_IO_file_flags |= old_error;
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/iofputs.c b/libio/iofputs.c
index 1a329bbe26..1805387303 100644
--- a/libio/iofputs.c
+++ b/libio/iofputs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -40,7 +40,8 @@ _IO_fputs (str, fp)
result = EOF;
else
result = 1;
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/iofread.c b/libio/iofread.c
index c83d2b638c..36640065d5 100644
--- a/libio/iofread.c
+++ b/libio/iofread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -40,7 +40,8 @@ _IO_fread (buf, size, count, fp)
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
_IO_flockfile (fp);
bytes_read = _IO_sgetn (fp, (char *) buf, bytes_requested);
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return bytes_requested == bytes_read ? count : bytes_read / size;
}
diff --git a/libio/iofsetpos.c b/libio/iofsetpos.c
index a8d816f5a3..cbf77347e7 100644
--- a/libio/iofsetpos.c
+++ b/libio/iofsetpos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -47,7 +47,8 @@ _IO_fsetpos (fp, posp)
}
else
result = 0;
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
}
diff --git a/libio/iofsetpos64.c b/libio/iofsetpos64.c
index 534e0cf3ca..13ce0fb3cb 100644
--- a/libio/iofsetpos64.c
+++ b/libio/iofsetpos64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -48,7 +48,8 @@ _IO_fsetpos64 (fp, posp)
}
else
result = 0;
- _IO_cleanup_region_end (1);
+ _IO_funlockfile (fp);
+ _IO_cleanup_region_end (0);
return result;
#else
__set_errno (ENOSYS);
diff --git a/libio/ioftell.c b/libio/ioftell.c
index d8a1ce1d24..3a0e7a6bc3 100644
--- a/libio/ioftell.c
+++ b/libio/ioftell.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
</