From: markus schnalke Date: Mon, 26 Mar 2012 20:44:13 +0000 (+0200) Subject: Make use of mkstemp() unconditional (vs. mktemp()). X-Git-Tag: mmh-thesis-end~183 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=0dc22c053a80549b21709e3a518d843203b5f65d;p=mmh Make use of mkstemp() unconditional (vs. mktemp()). Merged from nmh. Thanks to Lyndon Nerenberg. --- 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 */