* bug#11586: mkstemp failure diagnostic lacks directory name
@ 2012-05-30 10:28 Jim Meyering
2012-05-30 14:21 ` Chong Yidong
0 siblings, 1 reply; 2+ messages in thread
From: Jim Meyering @ 2012-05-30 10:28 UTC (permalink / raw
To: 11586
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#11586: mkstemp failure diagnostic lacks directory name
2012-05-30 10:28 bug#11586: mkstemp failure diagnostic lacks directory name Jim Meyering
@ 2012-05-30 14:21 ` Chong Yidong
0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2012-05-30 14:21 UTC (permalink / raw
To: Jim Meyering; +Cc: 11586
Jim Meyering <jim@meyering.net> writes:
> 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
Looks good; committed to trunk. Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-30 14:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 10:28 bug#11586: mkstemp failure diagnostic lacks directory name Jim Meyering
2012-05-30 14:21 ` Chong Yidong
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.