blob: ead7e30c6c8845d3829d18066632db323a6bc54f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
$NetBSD: patch-ao,v 1.1 2004/05/06 13:46:23 taca Exp $
--- common/maillock.c.orig Thu Mar 13 11:06:36 2003
+++ common/maillock.c
@@ -272,13 +272,13 @@ Qmaillock ( char *drop_name,
if ( bNo_atomic_open ) {
while ( fd == -1 ) {
+ char tempdir[FILENAME_MAX];
/*
* Create a temporary file and link it to lock file
*/
- pTmp = tempnam ( pSpool_dir, "POP" );
- if ( pTmp != NULL ) {
- fd = open ( pTmp, O_CREAT | O_EXCL, 0600 );
- }
+ Qsprintf(tempdir, "%s/POPXXXXXXXXXX", pSpool_dir);
+ fd = mkstemp(tempdir);
+ pTmp = strdup(tempdir);
if ( fd == -1 ) {
if ( DEBUGGING && bDebugging ) {
logit ( fTrace, POP_DEBUG, HERE,
|