aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-07-17 08:32:35 +0000
committerUlrich Drepper <drepper@redhat.com>2001-07-17 08:32:35 +0000
commit2706ee382341eb1c2e5f96c7d90f346696dbd0d8 (patch)
treec29690519bcb43604d9e0affa936aa7a2798660a /misc
parent23700036397721389b90ac41571d68df2f26ad67 (diff)
downloadglibc-2706ee382341eb1c2e5f96c7d90f346696dbd0d8.zip
glibc-2706ee382341eb1c2e5f96c7d90f346696dbd0d8.tar.gz
glibc-2706ee382341eb1c2e5f96c7d90f346696dbd0d8.tar.bz2
Update.
2001-07-17 Ulrich Drepper <drepper@redhat.com> * inet/rcmd.c (iruserfopen): Disable implicit locking for the stream. * inet/ruserpass.c (ruserpass): Likewise. * nss/nsswitch.c (nss_parse_file): Likewise. * resolv/res_hconf.c (_res_hconf_init): Likewise. * resolv/res_init.c (__res_vinit): Likewise. * gmon/bb_exit_func.c (__bb_exit_func): Likewise. * misc/getpass.c (getpass): Likewise. * misc/getusershell.c (initshells): Likewise. * misc/getttyent.c (setttyent): Likewise. * misc/mntent_r.c (__setmntent): Likewise. * time/getdate.c (__getdate_r): Likewise. * time/tzfile.c (__tzfile_read): Likewise. * iconv/gconv_conf.c (read_conf_file): Likewise. * intl/localealias.c (read_alias_file): Disable implicit locking for the stream. Use _unlocked functions for glibc. * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Disable implicit locking for the stream. (__get_nprocs_conf): Likewise. (phys_pages_info): Likewise.
Diffstat (limited to 'misc')
-rw-r--r--misc/getpass.c10
-rw-r--r--misc/getttyent.c6
-rw-r--r--misc/getusershell.c3
-rw-r--r--misc/mntent_r.c11
4 files changed, 25 insertions, 5 deletions
diff --git a/misc/getpass.c b/misc/getpass.c
index 2af6b98..e9bd889 100644
--- a/misc/getpass.c
+++ b/misc/getpass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1992,93,94,95,96,97,98,99,2001 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
@@ -17,6 +17,7 @@
02111-1307 USA. */
#include <stdio.h>
+#include <stdio_ext.h>
#include <termios.h>
#include <unistd.h>
@@ -55,7 +56,12 @@ getpass (prompt)
out = stderr;
}
else
- out = in;
+ {
+ /* We do the locking ourselves. */
+ __fsetlocking (tf, FSETLOCKING_BYCALLER);
+
+ out = in;
+ }
flockfile (out);
diff --git a/misc/getttyent.c b/misc/getttyent.c
index 3295a6e..dfc57d5 100644
--- a/misc/getttyent.c
+++ b/misc/getttyent.c
@@ -33,6 +33,7 @@ static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) 6/4/93";
#include <ttyent.h>
#include <stdio.h>
+#include <stdio_ext.h>
#include <ctype.h>
#include <string.h>
@@ -190,8 +191,11 @@ setttyent()
if (tf) {
(void)rewind(tf);
return (1);
- } else if ((tf = fopen(_PATH_TTYS, "r")))
+ } else if ((tf = fopen(_PATH_TTYS, "r"))) {
+ /* We do the locking ourselves. */
+ __fsetlocking (tf, FSETLOCKING_BYCALLER);
return (1);
+ }
return (0);
}
diff --git a/misc/getusershell.c b/misc/getusershell.c
index 5ac08ce..c15b8f6 100644
--- a/misc/getusershell.c
+++ b/misc/getusershell.c
@@ -35,6 +35,7 @@ static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93";
#include <sys/file.h>
#include <sys/stat.h>
#include <stdio.h>
+#include <stdio_ext.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
@@ -116,6 +117,8 @@ initshells()
strings = NULL;
return (char **) okshells;
}
+ /* No threads using this stream. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
sp = shells;
cp = strings;
flen = statb.st_size;
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index e77b06c..7d86626 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -1,5 +1,5 @@
/* Utilities for reading/writing fstab, mtab, etc.
- Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995-2000, 2001 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
@@ -20,6 +20,7 @@
#include <alloca.h>
#include <mntent.h>
#include <stdio.h>
+#include <stdio_ext.h>
#include <string.h>
#include <sys/types.h>
@@ -33,7 +34,13 @@
FILE *
__setmntent (const char *file, const char *mode)
{
- return fopen (file, mode);
+ FILE *result = fopen (file, mode);
+
+ if (result != NULL)
+ /* We do the locking ourselves. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+
+ return result;
}
weak_alias (__setmntent, setmntent)