diff options
| author | Paul Eggert | 2011-12-10 16:56:50 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-12-10 16:56:50 -0800 |
| commit | 8f50130c565eaf0ad7c49e4ad044c3291ecdfa71 (patch) | |
| tree | c8129448cbbf387fe82667ccac02983592c688f1 /src/process.c | |
| parent | 85a83e2e2585a1906dec5168ed96ad521b5849ed (diff) | |
| parent | 7b9d523a07395ecea505be88f45c33d73aea7038 (diff) | |
| download | emacs-8f50130c565eaf0ad7c49e4ad044c3291ecdfa71.tar.gz emacs-8f50130c565eaf0ad7c49e4ad044c3291ecdfa71.zip | |
Merge from trunk.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 68 |
1 files changed, 50 insertions, 18 deletions
diff --git a/src/process.c b/src/process.c index 71da2e17670..206af7059fb 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1408,7 +1408,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1408 | val = XCDR (Vdefault_process_coding_system); | 1408 | val = XCDR (Vdefault_process_coding_system); |
| 1409 | } | 1409 | } |
| 1410 | XPROCESS (proc)->encode_coding_system = val; | 1410 | XPROCESS (proc)->encode_coding_system = val; |
| 1411 | /* Note: At this momemnt, the above coding system may leave | 1411 | /* Note: At this moment, the above coding system may leave |
| 1412 | text-conversion or eol-conversion unspecified. They will be | 1412 | text-conversion or eol-conversion unspecified. They will be |
| 1413 | decided after we read output from the process and decode it by | 1413 | decided after we read output from the process and decode it by |
| 1414 | some coding system, or just before we actually send a text to | 1414 | some coding system, or just before we actually send a text to |
| @@ -1515,8 +1515,9 @@ start_process_unwind (Lisp_Object proc) | |||
| 1515 | if (!PROCESSP (proc)) | 1515 | if (!PROCESSP (proc)) |
| 1516 | abort (); | 1516 | abort (); |
| 1517 | 1517 | ||
| 1518 | /* Was PROC started successfully? */ | 1518 | /* Was PROC started successfully? |
| 1519 | if (XPROCESS (proc)->pid == -1) | 1519 | -2 is used for a pty with no process, eg for gdb. */ |
| 1520 | if (XPROCESS (proc)->pid <= 0 && XPROCESS (proc)->pid != -2) | ||
| 1520 | remove_process (proc); | 1521 | remove_process (proc); |
| 1521 | 1522 | ||
| 1522 | return Qnil; | 1523 | return Qnil; |
| @@ -3470,7 +3471,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3470 | 3471 | ||
| 3471 | { | 3472 | { |
| 3472 | /* Setup coding systems for communicating with the network stream. */ | 3473 | /* Setup coding systems for communicating with the network stream. */ |
| 3473 | struct gcpro inner_gcpro1; | 3474 | struct gcpro gcpro1; |
| 3474 | /* Qt denotes we have not yet called Ffind_operation_coding_system. */ | 3475 | /* Qt denotes we have not yet called Ffind_operation_coding_system. */ |
| 3475 | Lisp_Object coding_systems = Qt; | 3476 | Lisp_Object coding_systems = Qt; |
| 3476 | Lisp_Object fargs[5], val; | 3477 | Lisp_Object fargs[5], val; |
| @@ -3498,9 +3499,9 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3498 | { | 3499 | { |
| 3499 | fargs[0] = Qopen_network_stream, fargs[1] = name, | 3500 | fargs[0] = Qopen_network_stream, fargs[1] = name, |
| 3500 | fargs[2] = buffer, fargs[3] = host, fargs[4] = service; | 3501 | fargs[2] = buffer, fargs[3] = host, fargs[4] = service; |
| 3501 | GCPRO1_VAR (proc, inner_gcpro); | 3502 | GCPRO1 (proc); |
| 3502 | coding_systems = Ffind_operation_coding_system (5, fargs); | 3503 | coding_systems = Ffind_operation_coding_system (5, fargs); |
| 3503 | UNGCPRO_VAR (inner_gcpro); | 3504 | UNGCPRO; |
| 3504 | } | 3505 | } |
| 3505 | if (CONSP (coding_systems)) | 3506 | if (CONSP (coding_systems)) |
| 3506 | val = XCAR (coding_systems); | 3507 | val = XCAR (coding_systems); |
| @@ -3531,9 +3532,9 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3531 | { | 3532 | { |
| 3532 | fargs[0] = Qopen_network_stream, fargs[1] = name, | 3533 | fargs[0] = Qopen_network_stream, fargs[1] = name, |
| 3533 | fargs[2] = buffer, fargs[3] = host, fargs[4] = service; | 3534 | fargs[2] = buffer, fargs[3] = host, fargs[4] = service; |
| 3534 | GCPRO1_VAR (proc, inner_gcpro); | 3535 | GCPRO1 (proc); |
| 3535 | coding_systems = Ffind_operation_coding_system (5, fargs); | 3536 | coding_systems = Ffind_operation_coding_system (5, fargs); |
| 3536 | UNGCPRO_VAR (inner_gcpro); | 3537 | UNGCPRO; |
| 3537 | } | 3538 | } |
| 3538 | } | 3539 | } |
| 3539 | if (CONSP (coding_systems)) | 3540 | if (CONSP (coding_systems)) |
| @@ -3713,7 +3714,7 @@ DEFUN ("network-interface-info", Fnetwork_interface_info, Snetwork_interface_inf | |||
| 3713 | doc: /* Return information about network interface named IFNAME. | 3714 | doc: /* Return information about network interface named IFNAME. |
| 3714 | The return value is a list (ADDR BCAST NETMASK HWADDR FLAGS), | 3715 | The return value is a list (ADDR BCAST NETMASK HWADDR FLAGS), |
| 3715 | where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address, | 3716 | where ADDR is the layer 3 address, BCAST is the layer 3 broadcast address, |
| 3716 | NETMASK is the layer 3 network mask, HWADDR is the layer 2 addres, and | 3717 | NETMASK is the layer 3 network mask, HWADDR is the layer 2 address, and |
| 3717 | FLAGS is the current flags of the interface. */) | 3718 | FLAGS is the current flags of the interface. */) |
| 3718 | (Lisp_Object ifname) | 3719 | (Lisp_Object ifname) |
| 3719 | { | 3720 | { |
| @@ -4606,15 +4607,46 @@ wait_reading_process_output (int time_limit, int microsecs, int read_kbd, | |||
| 4606 | some data in the TCP buffers so that select works, but | 4607 | some data in the TCP buffers so that select works, but |
| 4607 | with custom pull/push functions we need to check if some | 4608 | with custom pull/push functions we need to check if some |
| 4608 | data is available in the buffers manually. */ | 4609 | data is available in the buffers manually. */ |
| 4609 | if (nfds == 0 && | 4610 | if (nfds == 0) |
| 4610 | wait_proc && wait_proc->gnutls_p /* Check for valid process. */ | 4611 | { |
| 4611 | /* Do we have pending data? */ | 4612 | if (! wait_proc) |
| 4612 | && emacs_gnutls_record_check_pending (wait_proc->gnutls_state) > 0) | 4613 | { |
| 4613 | { | 4614 | /* We're not waiting on a specific process, so loop |
| 4614 | nfds = 1; | 4615 | through all the channels and check for data. |
| 4615 | /* Set to Available. */ | 4616 | This is a workaround needed for some versions of |
| 4616 | FD_SET (wait_proc->infd, &Available); | 4617 | the gnutls library -- 2.12.14 has been confirmed |
| 4617 | } | 4618 | to need it. See |
| 4619 | http://comments.gmane.org/gmane.emacs.devel/145074 */ | ||
| 4620 | for (channel = 0; channel < MAXDESC; ++channel) | ||
| 4621 | if (! NILP (chan_process[channel])) | ||
| 4622 | { | ||
| 4623 | struct Lisp_Process *p = | ||
| 4624 | XPROCESS (chan_process[channel]); | ||
| 4625 | if (p && p->gnutls_p && p->infd | ||
| 4626 | && ((emacs_gnutls_record_check_pending | ||
| 4627 | (p->gnutls_state)) | ||
| 4628 | > 0)) | ||
| 4629 | { | ||
| 4630 | nfds++; | ||
| 4631 | FD_SET (p->infd, &Available); | ||
| 4632 | } | ||
| 4633 | } | ||
| 4634 | } | ||
| 4635 | else | ||
| 4636 | { | ||
| 4637 | /* Check this specific channel. */ | ||
| 4638 | if (wait_proc->gnutls_p /* Check for valid process. */ | ||
| 4639 | /* Do we have pending data? */ | ||
| 4640 | && ((emacs_gnutls_record_check_pending | ||
| 4641 | (wait_proc->gnutls_state)) | ||
| 4642 | > 0)) | ||
| 4643 | { | ||
| 4644 | nfds = 1; | ||
| 4645 | /* Set to Available. */ | ||
| 4646 | FD_SET (wait_proc->infd, &Available); | ||
| 4647 | } | ||
| 4648 | } | ||
| 4649 | } | ||
| 4618 | #endif | 4650 | #endif |
| 4619 | } | 4651 | } |
| 4620 | 4652 | ||