From e1e3c5d80c356261e7324a89c0ac144dcee84086 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 15 Aug 1998 23:11:31 +0000 Subject: go back to using mktemp, not mkstemp in baditem(); theo --- libexec/mail.local/locking.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libexec/mail.local/locking.c b/libexec/mail.local/locking.c index c0a4b8e95c4..80ca1244dc3 100644 --- a/libexec/mail.local/locking.c +++ b/libexec/mail.local/locking.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locking.c,v 1.1 1998/08/15 21:04:33 millert Exp $ */ +/* $OpenBSD: locking.c,v 1.2 1998/08/15 23:11:30 millert Exp $ */ /* * Copyright (c) 1996-1998 Theo de Raadt @@ -29,7 +29,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: locking.c,v 1.1 1998/08/15 21:04:33 millert Exp $"; +static char rcsid[] = "$OpenBSD: locking.c,v 1.2 1998/08/15 23:11:30 millert Exp $"; #endif /* not lint */ #include @@ -146,14 +146,12 @@ baditem(path) char *path; { char npath[MAXPATHLEN]; - int fd; if (unlink(path) == 0) return; snprintf(npath, sizeof npath, "%s/mailXXXXXXXXXX", _PATH_MAILDIR); - if ((fd = mkstemp(npath)) == -1) + if (mktemp(npath) == NULL) return; - (void)close(fd); if (rename(path, npath) == -1) unlink(npath); else -- cgit v1.2.3