Mercurial > hg > xemacs-beta
comparison src/process-nt.c @ 4990:8f0cf4fd3d2c
Automatic merge
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Sat, 06 Feb 2010 04:01:46 -0600 |
| parents | 4aebb0131297 |
| children | b5df3737028a |
comparison
equal
deleted
inserted
replaced
| 4989:d2ec55325515 | 4990:8f0cf4fd3d2c |
|---|---|
| 691 * which fits into Lisp_Int. No return value indicates an error, the method | 691 * which fits into Lisp_Int. No return value indicates an error, the method |
| 692 * must signal an error instead. | 692 * must signal an error instead. |
| 693 */ | 693 */ |
| 694 | 694 |
| 695 static DOESNT_RETURN | 695 static DOESNT_RETURN |
| 696 mswindows_report_winsock_error (const char *string, Lisp_Object data, | 696 mswindows_report_winsock_error (const Ascbyte *reason, Lisp_Object data, |
| 697 int errnum) | 697 int errnum) |
| 698 { | 698 { |
| 699 report_file_type_error (Qnetwork_error, mswindows_lisp_error (errnum), | 699 signal_error_2 (Qnetwork_error, reason, mswindows_lisp_error (errnum), data); |
| 700 string, data); | |
| 701 } | 700 } |
| 702 | 701 |
| 703 static void | 702 static void |
| 704 ensure_console_window_exists (void) | 703 ensure_console_window_exists (void) |
| 705 { | 704 { |
| 859 invalid_argument | 858 invalid_argument |
| 860 ("Bogus return value from `mswindows-construct-process-command-line'", | 859 ("Bogus return value from `mswindows-construct-process-command-line'", |
| 861 args_or_ret); | 860 args_or_ret); |
| 862 | 861 |
| 863 /* #### What about path names, which may be links? */ | 862 /* #### What about path names, which may be links? */ |
| 864 LISP_STRING_TO_TSTR (args_or_ret, command_line); | 863 command_line = LISP_STRING_TO_TSTR (args_or_ret); |
| 865 | 864 |
| 866 UNGCPRO; /* args_or_ret */ | 865 UNGCPRO; /* args_or_ret */ |
| 867 } | 866 } |
| 868 | 867 |
| 869 /* Set `proc_env' to a nul-separated array of the strings in | 868 /* Set `proc_env' to a nul-separated array of the strings in |
| 1235 /* First check if HOST is already a numeric address */ | 1234 /* First check if HOST is already a numeric address */ |
| 1236 { | 1235 { |
| 1237 Extbyte *hostext; | 1236 Extbyte *hostext; |
| 1238 unsigned long inaddr; | 1237 unsigned long inaddr; |
| 1239 | 1238 |
| 1240 LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding); | 1239 hostext = LISP_STRING_TO_EXTERNAL (host, Qmswindows_host_name_encoding); |
| 1241 inaddr = inet_addr (hostext); | 1240 inaddr = inet_addr (hostext); |
| 1242 if (inaddr != INADDR_NONE) | 1241 if (inaddr != INADDR_NONE) |
| 1243 { | 1242 { |
| 1244 address->sin_addr.s_addr = inaddr; | 1243 address->sin_addr.s_addr = inaddr; |
| 1245 return 0; | 1244 return 0; |
| 1253 | 1252 |
| 1254 /* Post name resolution request */ | 1253 /* Post name resolution request */ |
| 1255 { | 1254 { |
| 1256 Extbyte *hostext; | 1255 Extbyte *hostext; |
| 1257 | 1256 |
| 1258 LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding); | 1257 hostext = LISP_STRING_TO_EXTERNAL (host, Qmswindows_host_name_encoding); |
| 1259 | 1258 |
| 1260 hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, hostext, | 1259 hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, hostext, |
| 1261 buf, sizeof (buf)); | 1260 buf, sizeof (buf)); |
| 1262 if (hasync == NULL) | 1261 if (hasync == NULL) |
| 1263 { | 1262 { |
| 1311 | 1310 |
| 1312 if (get_internet_address (host, &address)) /* error */ | 1311 if (get_internet_address (host, &address)) /* error */ |
| 1313 return host; | 1312 return host; |
| 1314 | 1313 |
| 1315 if (address.sin_family == AF_INET) | 1314 if (address.sin_family == AF_INET) |
| 1316 return build_string (inet_ntoa (address.sin_addr)); | 1315 return build_extstring (inet_ntoa (address.sin_addr), |
| 1316 Qunix_host_name_encoding); | |
| 1317 else | 1317 else |
| 1318 return host; | 1318 return host; |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 /* open a TCP network connection to a given HOST/SERVICE. Treated | 1321 /* open a TCP network connection to a given HOST/SERVICE. Treated |
| 1346 { | 1346 { |
| 1347 struct servent *svc_info; | 1347 struct servent *svc_info; |
| 1348 Extbyte *servext; | 1348 Extbyte *servext; |
| 1349 | 1349 |
| 1350 CHECK_STRING (service); | 1350 CHECK_STRING (service); |
| 1351 LISP_STRING_TO_EXTERNAL (service, servext, | 1351 servext = LISP_STRING_TO_EXTERNAL (service, |
| 1352 Qmswindows_service_name_encoding); | 1352 Qmswindows_service_name_encoding); |
| 1353 | 1353 |
| 1354 svc_info = getservbyname (servext, "tcp"); | 1354 svc_info = getservbyname (servext, "tcp"); |
| 1355 if (svc_info == 0) | 1355 if (svc_info == 0) |
| 1356 invalid_argument ("Unknown service", service); | 1356 invalid_argument ("Unknown service", service); |
| 1357 port = svc_info->s_port; | 1357 port = svc_info->s_port; |
