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
commit4e2bc789ab5be94f151dea55ba4395218c4f5871 (patch)
tree789fb12207eb38eb12ff45ff2094bc548f121ed2 /lib/getusershell.c
parentda0732da37f02057f03e32c31a8d30d8b9a6da98 (diff)
downloadcoreutils-4e2bc789ab5be94f151dea55ba4395218c4f5871.tar.xz
(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 75163ac26..93d5e438e 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. */