From: Jim Meyering <jim@meyering.net>
To: 11586@debbugs.gnu.org
Subject: bug#11586: mkstemp failure diagnostic lacks directory name
Date: Wed, 30 May 2012 12:28:29 +0200 [thread overview]
Message-ID: <87d35mt12q.fsf@rho.meyering.net> (raw)
In emacs I tried to filter a section of an input file
through a pipe and got this diagnostic:
byte-code: Failed to open temporary file: No such file or directory, emacsXXXXXX
Knowing it's due to mkstemp failure, most would suspect that
/tmp is missing. But I set TMPDIR to a different private directory
for each shell, and for me it means that the parent shell's
temporary directory had been removed. Oops.
It should be easy to work around simply by recreating that directory,
but the diagnostic doesn't include the directory name.
Sure, I was able to work around it by inspecting emacs's
view of $TMPDIR, but I shouldn't have had to do that.
With the tiny patch below, I now get a diagnostic like this:
byte-code: Failed to open temporary file: No such file or directory, /t/jt-toGrGn/emacs3gdoKc
From a389e755b74e048a34628b4f5ccad9f244e99cc3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 30 May 2012 12:25:58 +0200
Subject: [PATCH] diagnose mkstemp failure with full file name
* callproc.c (Fcall_process_region): Diagnose mkstemp failure using
the full, expanded name, including the directory part, not just
the basename template.
---
src/ChangeLog | 6 ++++++
src/callproc.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index edf68a5..5d9e86e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-30 Jim Meyering <meyering@redhat.com>
+
+ * callproc.c (Fcall_process_region): Diagnose mkstemp failure using
+ the full, expanded name, including the directory part, not just
+ the basename template.
+
2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c, lisp.h (make_pure_vector): Now static.
diff --git a/src/callproc.c b/src/callproc.c
index f7c9971..976d306 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1015,7 +1015,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
UNBLOCK_INPUT;
if (fd == -1)
report_file_error ("Failed to open temporary file",
- Fcons (Vtemp_file_name_pattern, Qnil));
+ Fcons (build_string (tempfile), Qnil));
else
close (fd);
}
--
1.7.10.2.605.gbefc5ed
next reply other threads:[~2012-05-30 10:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 10:28 Jim Meyering [this message]
2012-05-30 14:21 ` bug#11586: mkstemp failure diagnostic lacks directory name Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d35mt12q.fsf@rho.meyering.net \
--to=jim@meyering.net \
--cc=11586@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.