From 77bc23cfa9f6738869bb7e652705413487048709 Mon Sep 17 00:00:00 2001 From: "Kurt A. Shoens" Date: Wed, 28 Jul 1982 22:37:22 -0800 Subject: [PATCH] changed demail to truncate mailbox if unlinking fails SCCS-vsn: usr.bin/mail/v7.local.c 2.2 --- usr/src/usr.bin/mail/v7.local.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/src/usr.bin/mail/v7.local.c b/usr/src/usr.bin/mail/v7.local.c index 7a72a3f82d..9a2ea7459a 100644 --- a/usr/src/usr.bin/mail/v7.local.c +++ b/usr/src/usr.bin/mail/v7.local.c @@ -10,7 +10,7 @@ #include "rcv.h" -static char *SccsId = "@(#)v7.local.c 2.1 %G%"; +static char *SccsId = "@(#)v7.local.c 2.2 %G%"; /* * Locate the user's mailbox file (ie, the place where new, unread @@ -38,8 +38,10 @@ demail() if (value("keep") != NOSTR) close(creat(mailname, 0666)); - else - remove(mailname); + else { + if (remove(mailname) < 0) + close(creat(mailname, 0666)); + } } /* -- 2.20.1