From: Timo Teräs Date: Wed, 6 Aug 2014 11:15:15 +0000 (+0300) Subject: make endmntent function handle null argument X-Git-Tag: v1.1.5~74 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0a24be213addfb32a8fdfc880fc2649f27d0b9ce;p=oweals%2Fmusl.git 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. --- 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; }