diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-08-06 14:15:15 +0300 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014-08-08 00:45:10 -0400 |
commit | 0a24be213addfb32a8fdfc880fc2649f27d0b9ce (patch) | |
tree | 79231817785af6f0da0b66a763e39eefc720482a | |
parent | 00733dd1cf791d13ff6155509cf139a5f7b2eecb (diff) | |
download | musl-0a24be213addfb32a8fdfc880fc2649f27d0b9ce.tar.gz musl-0a24be213addfb32a8fdfc880fc2649f27d0b9ce.tar.bz2 musl-0a24be213addfb32a8fdfc880fc2649f27d0b9ce.tar.xz musl-0a24be213addfb32a8fdfc880fc2649f27d0b9ce.zip |
make endmntent function handle null argument
The function originates from SunOS 4.x in which the null argument
is allowed. glibc also handles this case.
-rw-r--r-- | src/misc/mntent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc/mntent.c b/src/misc/mntent.c index 3eafba5e..a16d6525 100644 --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -10,7 +10,7 @@ FILE *setmntent(const char *name, const char *mode) int endmntent(FILE *f) { - fclose(f); + if (f) fclose(f); return 1; } |