diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-06-12 17:15:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-06-12 17:15:25 +0000 |
commit | fdbd51bdf6100f0b2fef67e4dbea0b7929d7efbb (patch) | |
tree | da355f29b1cbe24548543740e6b802c26b2370ee /usr.bin/mail/v7.local.c | |
parent | 155889118c3255ee017d5aa79188b7a40e242ea7 (diff) |
Properly delete messages that the user has deleted in his/her spool.
I fudged up the logic when I replaced an unlink with a truncate.
Diffstat (limited to 'usr.bin/mail/v7.local.c')
-rw-r--r-- | usr.bin/mail/v7.local.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mail/v7.local.c b/usr.bin/mail/v7.local.c index 467df474c1d..1bd7e77e336 100644 --- a/usr.bin/mail/v7.local.c +++ b/usr.bin/mail/v7.local.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v7.local.c,v 1.10 1998/05/04 05:37:53 millert Exp $ */ +/* $OpenBSD: v7.local.c,v 1.11 1998/06/12 17:15:24 millert Exp $ */ /* $NetBSD: v7.local.c,v 1.8 1997/05/13 06:15:58 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)v7.local.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: v7.local.c,v 1.10 1998/05/04 05:37:53 millert Exp $"; +static char rcsid[] = "$OpenBSD: v7.local.c,v 1.11 1998/06/12 17:15:24 millert Exp $"; #endif #endif /* not lint */ @@ -86,8 +86,8 @@ void demail() { - if (value("keep") != NULL) - (void)truncate(mailname, 0); + if (value("keep") != NULL || truncate(mailname, 0) == -1) + (void)close(creat(mailname, 0600)); } /* |