summaryrefslogtreecommitdiff
path: root/lib/getusershell.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-11-07 15:35:15 +0000
committerJim Meyering <jim@meyering.net>2000-11-07 15:35:15 +0000
commit3e391882aa38108e1227fa2734899aaeb6450800 (patch)
treeadb12583bfbd4110eabaf0211c1f2b2a231d7fce /lib/getusershell.c
parentf68ccb908598334800574c4d8d2dcfdc3bfd5c26 (diff)
downloadgnulib-3e391882aa38108e1227fa2734899aaeb6450800.tar.gz
(setusershell): Use rewind rather than
fseek/fseeko, to avoid configuration hassles with fseeko. Don't bother opening SHELLS_FILE if shellstream is NULL; it's not necessary.
Diffstat (limited to 'lib/getusershell.c')
-rw-r--r--lib/getusershell.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/getusershell.c b/lib/getusershell.c
index 75163ac26f..93d5e438ef 100644
--- a/lib/getusershell.c
+++ b/lib/getusershell.c
@@ -100,16 +100,8 @@ void
setusershell ()
{
default_index = 0;
- if (shellstream == NULL)
- shellstream = fopen (SHELLS_FILE, "r");
- else
- {
-#ifdef HAVE_FSEEKO
- fseeko (shellstream, 0, 0);
-#else
- fseek (shellstream, 0L, 0);
-#endif
- }
+ if (shellstream)
+ rewind (shellstream);
}
/* Close the shells file. */