From 0dc22c053a80549b21709e3a518d843203b5f65d Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Mon, 26 Mar 2012 22:44:13 +0200 Subject: [PATCH] Make use of mkstemp() unconditional (vs. mktemp()). Merged from nmh. Thanks to Lyndon Nerenberg. --- configure.ac | 2 +- sbr/lock_file.c | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index c81fe61..8c9262b 100644 --- a/configure.ac +++ b/configure.ac @@ -364,7 +364,7 @@ dnl --------------- dnl CHECK FUNCTIONS dnl --------------- AC_CHECK_FUNCS(waitpid sigaction sigprocmask sigblock sigsetmask \ - sighold sigrelse lstat tzset mkstemp \ + sighold sigrelse lstat tzset \ getutent nl_langinfo mbtowc wcwidth) dnl sigsetjmp may be a macro diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 983d9d7..6b74068 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -435,18 +435,8 @@ lockit(struct lockinfo *li) curlock = li->curlock; tmplock = li->tmplock; -#ifdef HAVE_MKSTEMP if ((fd = mkstemp(tmplock)) == -1) return -1; -#else - if (mktemp(tmplock) == NULL) - return -1; - if (unlink(tmplock) == -1 && errno != ENOENT) - return -1; - /* create the temporary lock file */ - if ((fd = creat(tmplock, 0600)) == -1) - return -1; -#endif #if 0 /* write our process id into lock file */ -- 1.7.10.4