summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail/quit.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-07-26 10:02:58 -0300
committerRenato Botelho <renato@netgate.com>2016-07-26 10:02:58 -0300
commit4008e6a2e9bc1ee9983a4cf7d23093d2015026d6 (patch)
tree571be021b9c4ba8d76b5527ff7029dba6d607bba /usr.bin/mail/quit.c
parenta3c20a378f7a9fa76e9301a43ac64ed07057d01e (diff)
parentc9c19c9c8410b1dcbd760d5382a6071ed8396652 (diff)
downloadFreeBSD-src-4008e6a2e9bc1ee9983a4cf7d23093d2015026d6.zip
FreeBSD-src-4008e6a2e9bc1ee9983a4cf7d23093d2015026d6.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
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