aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-06 12:41:53 +0000
committerGerd Moellmann2000-03-06 12:41:53 +0000
commit4dd8a783b3058fbba531054ee63299b7488a1d72 (patch)
treec033c69d7f48c02bc4ee7e85a2555ddfb42c5c2f /src
parent4336c70520accb670fa8dc472d04f0efaae9a77c (diff)
downloademacs-4dd8a783b3058fbba531054ee63299b7488a1d72.tar.gz
emacs-4dd8a783b3058fbba531054ee63299b7488a1d72.zip
(send_process): Remove local variable `procname' that
might become invalid when a GC happens. Instead, access the process name slot directly.
Diffstat (limited to 'src')
-rw-r--r--src/process.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c
index 1b2693bded4..7f7fb8e9cf8 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3260,7 +3260,6 @@ send_process (proc, buf, len, object)
3260{ 3260{
3261 /* Use volatile to protect variables from being clobbered by longjmp. */ 3261 /* Use volatile to protect variables from being clobbered by longjmp. */
3262 int rv; 3262 int rv;
3263 volatile unsigned char *procname = XSTRING (XPROCESS (proc)->name)->data;
3264 struct coding_system *coding; 3263 struct coding_system *coding;
3265 struct gcpro gcpro1; 3264 struct gcpro gcpro1;
3266 int carryover = XINT (XPROCESS (proc)->encoding_carryover); 3265 int carryover = XINT (XPROCESS (proc)->encoding_carryover);
@@ -3275,9 +3274,11 @@ send_process (proc, buf, len, object)
3275 if (! NILP (XPROCESS (proc)->raw_status_low)) 3274 if (! NILP (XPROCESS (proc)->raw_status_low))
3276 update_status (XPROCESS (proc)); 3275 update_status (XPROCESS (proc));
3277 if (! EQ (XPROCESS (proc)->status, Qrun)) 3276 if (! EQ (XPROCESS (proc)->status, Qrun))
3278 error ("Process %s not running", procname); 3277 error ("Process %s not running",
3278 XSTRING (XPROCESS (proc)->name)->data);
3279 if (XINT (XPROCESS (proc)->outfd) < 0) 3279 if (XINT (XPROCESS (proc)->outfd) < 0)
3280 error ("Output file descriptor of %s is closed", procname); 3280 error ("Output file descriptor of %s is closed",
3281 XSTRING (XPROCESS (proc)->name)->data);
3281 3282
3282 coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; 3283 coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)];
3283 Vlast_coding_system_used = coding->symbol; 3284 Vlast_coding_system_used = coding->symbol;
@@ -3490,9 +3491,11 @@ send_process (proc, buf, len, object)
3490 XSETINT (XPROCESS (proc)->tick, ++process_tick); 3491 XSETINT (XPROCESS (proc)->tick, ++process_tick);
3491 deactivate_process (proc); 3492 deactivate_process (proc);
3492#ifdef VMS 3493#ifdef VMS
3493 error ("Error writing to process %s; closed it", procname); 3494 error ("Error writing to process %s; closed it",
3495 XSTRING (XPROCESS (proc)->name)->data);
3494#else 3496#else
3495 error ("SIGPIPE raised on process %s; closed it", procname); 3497 error ("SIGPIPE raised on process %s; closed it",
3498 XSTRING (XPROCESS (proc)->name)->data);
3496#endif 3499#endif
3497 } 3500 }
3498 3501