Mercurial > emacs
comparison src/process.c @ 109160:f8660b83cdbf
Fix whitespace to follow coding guidelines.
| author | Juanma Barranquero <lekktu@gmail.com> |
|---|---|
| date | Wed, 07 Jul 2010 11:45:28 +0200 |
| parents | d0090a8b66c3 |
| children | a7b09b567d58 |
comparison
equal
deleted
inserted
replaced
| 109159:3e9fdeb960d1 | 109160:f8660b83cdbf |
|---|---|
| 3001 p->decoding_carryover = 0; | 3001 p->decoding_carryover = 0; |
| 3002 p->encoding_buf = make_uninit_string (0); | 3002 p->encoding_buf = make_uninit_string (0); |
| 3003 p->inherit_coding_system_flag | 3003 p->inherit_coding_system_flag |
| 3004 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); | 3004 = !(!NILP (tem) || NILP (buffer) || !inherit_process_coding_system); |
| 3005 | 3005 |
| 3006 Fserial_process_configure(nargs, args); | 3006 Fserial_process_configure (nargs, args); |
| 3007 | 3007 |
| 3008 specpdl_ptr = specpdl + specpdl_count; | 3008 specpdl_ptr = specpdl + specpdl_count; |
| 3009 | 3009 |
| 3010 UNGCPRO; | 3010 UNGCPRO; |
| 3011 return proc; | 3011 return proc; |
| 3399 #endif | 3399 #endif |
| 3400 | 3400 |
| 3401 ret = getaddrinfo (SDATA (host), portstring, &hints, &res); | 3401 ret = getaddrinfo (SDATA (host), portstring, &hints, &res); |
| 3402 if (ret) | 3402 if (ret) |
| 3403 #ifdef HAVE_GAI_STRERROR | 3403 #ifdef HAVE_GAI_STRERROR |
| 3404 error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret)); | 3404 error ("%s/%s %s", SDATA (host), portstring, gai_strerror (ret)); |
| 3405 #else | 3405 #else |
| 3406 error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); | 3406 error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); |
| 3407 #endif | 3407 #endif |
| 3408 immediate_quit = 0; | 3408 immediate_quit = 0; |
| 3409 | 3409 |
| 3898 if (s < 0) | 3898 if (s < 0) |
| 3899 return Qnil; | 3899 return Qnil; |
| 3900 | 3900 |
| 3901 again: | 3901 again: |
| 3902 ifaces += 25; | 3902 ifaces += 25; |
| 3903 buf_size = ifaces * sizeof(ifreqs[0]); | 3903 buf_size = ifaces * sizeof (ifreqs[0]); |
| 3904 ifreqs = (struct ifreq *)xrealloc(ifreqs, buf_size); | 3904 ifreqs = (struct ifreq *)xrealloc(ifreqs, buf_size); |
| 3905 if (!ifreqs) | 3905 if (!ifreqs) |
| 3906 { | 3906 { |
| 3907 close (s); | 3907 close (s); |
| 3908 return Qnil; | 3908 return Qnil; |
| 4360 Lisp_Object args[9]; | 4360 Lisp_Object args[9]; |
| 4361 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; | 4361 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; |
| 4362 int i; | 4362 int i; |
| 4363 args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); | 4363 args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); |
| 4364 for (i = 0; i < 8; i++) | 4364 for (i = 0; i < 8; i++) |
| 4365 args[i+1] = make_number (ntohs(ip6[i])); | 4365 args[i+1] = make_number (ntohs (ip6[i])); |
| 4366 host = Fformat (9, args); | 4366 host = Fformat (9, args); |
| 4367 service = make_number (ntohs (saddr.in.sin_port)); | 4367 service = make_number (ntohs (saddr.in.sin_port)); |
| 4368 | 4368 |
| 4369 args[0] = build_string (" <[%s]:%d>"); | 4369 args[0] = build_string (" <[%s]:%d>"); |
| 4370 args[1] = host; | 4370 args[1] = host; |
| 5162 | 5162 |
| 5163 #ifdef GNU_LINUX | 5163 #ifdef GNU_LINUX |
| 5164 /* getsockopt(,,SO_ERROR,,) is said to hang on some systems. | 5164 /* getsockopt(,,SO_ERROR,,) is said to hang on some systems. |
| 5165 So only use it on systems where it is known to work. */ | 5165 So only use it on systems where it is known to work. */ |
| 5166 { | 5166 { |
| 5167 int xlen = sizeof(xerrno); | 5167 int xlen = sizeof (xerrno); |
| 5168 if (getsockopt(channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) | 5168 if (getsockopt (channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) |
| 5169 xerrno = errno; | 5169 xerrno = errno; |
| 5170 } | 5170 } |
| 5171 #else | 5171 #else |
| 5172 { | 5172 { |
| 5173 struct sockaddr pname; | 5173 struct sockaddr pname; |
| 5174 int pnamelen = sizeof(pname); | 5174 int pnamelen = sizeof (pname); |
| 5175 | 5175 |
| 5176 /* If connection failed, getpeername will fail. */ | 5176 /* If connection failed, getpeername will fail. */ |
| 5177 xerrno = 0; | 5177 xerrno = 0; |
| 5178 if (getpeername(channel, &pname, &pnamelen) < 0) | 5178 if (getpeername (channel, &pname, &pnamelen) < 0) |
| 5179 { | 5179 { |
| 5180 /* Obtain connect failure code through error slippage. */ | 5180 /* Obtain connect failure code through error slippage. */ |
| 5181 char dummy; | 5181 char dummy; |
| 5182 xerrno = errno; | 5182 xerrno = errno; |
| 5183 if (errno == ENOTCONN && read(channel, &dummy, 1) < 0) | 5183 if (errno == ENOTCONN && read (channel, &dummy, 1) < 0) |
| 5184 xerrno = errno; | 5184 xerrno = errno; |
| 5185 } | 5185 } |
| 5186 } | 5186 } |
| 5187 #endif | 5187 #endif |
| 5188 if (xerrno) | 5188 if (xerrno) |
| 6334 unsigned char *name; | 6334 unsigned char *name; |
| 6335 | 6335 |
| 6336 CHECK_SYMBOL (sigcode); | 6336 CHECK_SYMBOL (sigcode); |
| 6337 name = SDATA (SYMBOL_NAME (sigcode)); | 6337 name = SDATA (SYMBOL_NAME (sigcode)); |
| 6338 | 6338 |
| 6339 if (!strncmp(name, "SIG", 3) || !strncmp(name, "sig", 3)) | 6339 if (!strncmp (name, "SIG", 3) || !strncmp (name, "sig", 3)) |
| 6340 name += 3; | 6340 name += 3; |
| 6341 | 6341 |
| 6342 if (0) | 6342 if (0) |
| 6343 ; | 6343 ; |
| 6344 #ifdef SIGUSR1 | 6344 #ifdef SIGUSR1 |
| 7250 #if defined (DARWIN_OS) | 7250 #if defined (DARWIN_OS) |
| 7251 /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive | 7251 /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive |
| 7252 processes. As such, we only change the default value. */ | 7252 processes. As such, we only change the default value. */ |
| 7253 if (initialized) | 7253 if (initialized) |
| 7254 { | 7254 { |
| 7255 char *release = get_operating_system_release(); | 7255 char *release = get_operating_system_release (); |
| 7256 if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION | 7256 if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION |
| 7257 && release[1] == '.')) { | 7257 && release[1] == '.')) { |
| 7258 Vprocess_connection_type = Qnil; | 7258 Vprocess_connection_type = Qnil; |
| 7259 } | 7259 } |
| 7260 } | 7260 } |
