aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPaul Eggert2013-07-16 09:39:42 -0700
committerPaul Eggert2013-07-16 09:39:42 -0700
commita9757f6a03cce5ff2931b1125a9a2249573c8e1c (patch)
tree540a3b5b9e4fc657ed85749d5ef10b5a125ce1c3 /src/process.c
parentc43843aa1ad80cc0e4f6dc2ab523727b10b10a22 (diff)
downloademacs-a9757f6a03cce5ff2931b1125a9a2249573c8e1c.tar.gz
emacs-a9757f6a03cce5ff2931b1125a9a2249573c8e1c.zip
* fileio.c (report_file_errno): Fix errno reporting bug.
If the file name is neither null nor a pair, package it up as a singleton list. All callers changed, both to this function and to report_file_error. This fixes a bug where the memory allocator invoked by list1 set errno so that the immediately following report_file_error reported the wrong errno value.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/process.c b/src/process.c
index 125a9389341..b51e3bab033 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1397,7 +1397,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1397 current_dir = expand_and_dir_to_file (current_dir, Qnil); 1397 current_dir = expand_and_dir_to_file (current_dir, Qnil);
1398 if (NILP (Ffile_accessible_directory_p (current_dir))) 1398 if (NILP (Ffile_accessible_directory_p (current_dir)))
1399 report_file_error ("Setting current directory", 1399 report_file_error ("Setting current directory",
1400 list1 (BVAR (current_buffer, directory))); 1400 BVAR (current_buffer, directory));
1401 1401
1402 UNGCPRO; 1402 UNGCPRO;
1403 } 1403 }
@@ -1519,7 +1519,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1519 openp (Vexec_path, program, Vexec_suffixes, &tem, make_number (X_OK)); 1519 openp (Vexec_path, program, Vexec_suffixes, &tem, make_number (X_OK));
1520 UNGCPRO; 1520 UNGCPRO;
1521 if (NILP (tem)) 1521 if (NILP (tem))
1522 report_file_error ("Searching for program", list1 (program)); 1522 report_file_error ("Searching for program", program);
1523 tem = Fexpand_file_name (tem, Qnil); 1523 tem = Fexpand_file_name (tem, Qnil);
1524 } 1524 }
1525 else 1525 else
@@ -5466,7 +5466,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
5466 if (rv >= 0) 5466 if (rv >= 0)
5467 written = rv; 5467 written = rv;
5468 else if (errno == EMSGSIZE) 5468 else if (errno == EMSGSIZE)
5469 report_file_error ("sending datagram", list1 (proc)); 5469 report_file_error ("sending datagram", proc);
5470 } 5470 }
5471 else 5471 else
5472#endif 5472#endif
@@ -5543,7 +5543,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
5543 } 5543 }
5544 else 5544 else
5545 /* This is a real error. */ 5545 /* This is a real error. */
5546 report_file_error ("writing to process", list1 (proc)); 5546 report_file_error ("writing to process", proc);
5547 } 5547 }
5548 cur_buf += written; 5548 cur_buf += written;
5549 cur_len -= written; 5549 cur_len -= written;