X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/034abb1cc56e6b4d15282635ea46f276b97680d8..fe4026749648d3f5693adce7ae7a218968a9beb5:/sbr/m_mktemp.c diff --git a/sbr/m_mktemp.c b/sbr/m_mktemp.c index 009df0a1..2a10ed8c 100644 --- a/sbr/m_mktemp.c +++ b/sbr/m_mktemp.c @@ -1,5 +1,4 @@ -/* - * m_mktemp.c -- Construct a temporary file. +/* m_mktemp.c -- Construct a temporary file. * * This code is Copyright (c) 2010, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for @@ -155,10 +154,9 @@ m_mktemps( if (suffix == NULL) { if ((tmpfil = m_mktemp2(NULL, pfx_in, fd_ret, fp_ret))) { - return add(tmpfil, NULL); - } else { - return NULL; + return mh_xstrdup(tmpfil); } + return NULL; } #if HAVE_MKSTEMPS @@ -170,7 +168,7 @@ m_mktemps( fd = mkstemps(tmpfil, (int) strlen(suffix)); #else /* ! HAVE_MKSTEMPS */ - /* Solaris 10, e.g. */ + /* NetBSD, Solaris 10 */ if (pfx_in == NULL) { tmpfil = concat(get_temp_dir(), "/nmhXXXXXX", NULL); @@ -355,13 +353,13 @@ remove_registered_files(int sig) { exit(1); } else { + remove_registered_files_atexit(); + act.sa_handler = SIG_DFL; (void) sigemptyset(&act.sa_mask); act.sa_flags = 0; (void) sigaction(sig, &act, 0); - remove_registered_files_atexit(); - (void) raise(sig); } }