Mercurial > emacs
comparison src/process.c @ 28012:9c8bcd7e4a4f
(send_process): Remove local variable `procname' that
might become invalid when a GC happens. Instead, access the
process name slot directly.
| author | Gerd Moellmann <gerd@gnu.org> |
|---|---|
| date | Mon, 06 Mar 2000 12:41:53 +0000 |
| parents | ef7c1ba652b2 |
| children | 336858b2b11a |
comparison
equal
deleted
inserted
replaced
| 28011:8232258537cc | 28012:9c8bcd7e4a4f |
|---|---|
| 3258 int len; | 3258 int len; |
| 3259 Lisp_Object object; | 3259 Lisp_Object 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); |
| 3267 | 3266 |
| 3268 GCPRO1 (object); | 3267 GCPRO1 (object); |
| 3273 #endif /* VMS */ | 3272 #endif /* VMS */ |
| 3274 | 3273 |
| 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; |
| 3284 | 3285 |
| 3285 if (CODING_REQUIRE_ENCODING (coding)) | 3286 if (CODING_REQUIRE_ENCODING (coding)) |
| 3488 XPROCESS (proc)->raw_status_high = Qnil; | 3489 XPROCESS (proc)->raw_status_high = Qnil; |
| 3489 XPROCESS (proc)->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); | 3490 XPROCESS (proc)->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); |
| 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 |
| 3499 UNGCPRO; | 3502 UNGCPRO; |
| 3500 } | 3503 } |
