summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/quit.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mail/quit.c')
-rw-r--r--usr.bin/mail/quit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/mail/quit.c b/usr.bin/mail/quit.c
index a960755..4b9bcda 100644
--- a/usr.bin/mail/quit.c
+++ b/usr.bin/mail/quit.c
@@ -228,7 +228,8 @@ quit(void)
return;
}
(void)Fclose(obuf);
- (void)close(open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600));
+ if ((fd = open(mbox, O_CREAT | O_TRUNC | O_WRONLY, 0600)) >= 0)
+ (void)close(fd);
if ((obuf = Fopen(mbox, "r+")) == NULL) {
warn("%s", mbox);
(void)Fclose(ibuf);
OpenPOWER on IntegriCloud