diff --git a/bootstrap.conf b/bootstrap.conf index bc31a5862..aee0c4f33 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -248,7 +248,6 @@ gnulib_modules=" readtokens0 readutmp regex - remove renameat renameatu rmdir diff --git a/src/mktemp.c b/src/mktemp.c index 72523be64..1fa797266 100644 --- a/src/mktemp.c +++ b/src/mktemp.c @@ -347,7 +347,7 @@ main (int argc, char **argv) if (!dry_run && ((stdout_closed = true), close_stream (stdout) != 0)) { int saved_errno = errno; - remove (dest_name); + (create_directory ? rmdir : unlink) (dest_name); if (!suppress_file_err) error (0, saved_errno, _("write error")); status = EXIT_FAILURE;