29 lines
678 B
Plaintext
29 lines
678 B
Plaintext
$OpenBSD: patch-sbr_lock_file_c,v 1.1 2002/09/30 00:29:02 pvalchev Exp $
|
|
--- sbr/lock_file.c.orig Sun Sep 12 07:50:12 1999
|
|
+++ sbr/lock_file.c Mon Sep 30 18:22:06 2002
|
|
@@ -463,16 +463,18 @@ lockname (char *file, struct lockinfo *l
|
|
else
|
|
snprintf (li->tmplock, sizeof(li->tmplock), "%.*s,LCK.XXXXXX",
|
|
cp - li->curlock, li->curlock);
|
|
-/*
|
|
- Mkstemp work postponed until later -Doug
|
|
#ifdef HAVE_MKSTEMP
|
|
- mkstemp (li->tmplock);
|
|
+ {
|
|
+ int lockfd;
|
|
+
|
|
+ lockfd = mkstemp (li->tmplock);
|
|
+ if (lockfd == -1)
|
|
+ return;
|
|
+ close (lockfd);
|
|
+ }
|
|
#else
|
|
-*/
|
|
mktemp (li->tmplock);
|
|
-/*
|
|
#endif
|
|
-*/
|
|
|
|
unlink (li->tmplock); /* remove any stray */
|
|
}
|