diff options
| author | Joakim Verona | 2013-02-17 00:04:23 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-17 00:04:23 +0100 |
| commit | bcd8c34aabe11e72a0ce35f654515e2bb9c2964b (patch) | |
| tree | a294d312b78bc7db718819f498df3a3bbf07258f /src | |
| parent | 613fda6799a504feff2d5a930ef7998125498d10 (diff) | |
| parent | ed8d7fcaa2965216d44388fd00a757c8d55e7395 (diff) | |
| download | emacs-bcd8c34aabe11e72a0ce35f654515e2bb9c2964b.tar.gz emacs-bcd8c34aabe11e72a0ce35f654515e2bb9c2964b.zip | |
auto upstream
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/w32.c | 136 | ||||
| -rw-r--r-- | src/w32term.c | 4 |
3 files changed, 86 insertions, 71 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6ff25edac50..4d39a32e883 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2013-02-16 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32.c (sys_chown): Remove unused function. | ||
| 4 | |||
| 5 | * w32term.c <input_signal_count>: Declare 'volatile' | ||
| 6 | unconditionally. (Bug#9066) | ||
| 7 | |||
| 8 | * w32.c (set_errno): Reset h_errno and don't set it to any other | ||
| 9 | value. Set errno instead. | ||
| 10 | (check_errno): Reset h_errno. | ||
| 11 | (sys_socket, socket_to_fd, sys_bind, sys_connect) | ||
| 12 | (sys_gethostname, sys_getservbyname, sys_getpeername) | ||
| 13 | (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname) | ||
| 14 | (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set | ||
| 15 | h_errno. | ||
| 16 | (sys_gethostbyname): Set h_errno only errors detected. | ||
| 17 | |||
| 1 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> | 18 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 19 | ||
| 3 | * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. | 20 | * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. |
| @@ -3220,14 +3220,6 @@ sys_chmod (const char * path, int mode) | |||
| 3220 | } | 3220 | } |
| 3221 | 3221 | ||
| 3222 | int | 3222 | int |
| 3223 | sys_chown (const char *path, uid_t owner, gid_t group) | ||
| 3224 | { | ||
| 3225 | if (sys_chmod (path, S_IREAD) == -1) /* check if file exists */ | ||
| 3226 | return -1; | ||
| 3227 | return 0; | ||
| 3228 | } | ||
| 3229 | |||
| 3230 | int | ||
| 3231 | sys_creat (const char * path, int mode) | 3223 | sys_creat (const char * path, int mode) |
| 3232 | { | 3224 | { |
| 3233 | return _creat (map_w32_filename (path, NULL), mode); | 3225 | return _creat (map_w32_filename (path, NULL), mode); |
| @@ -6092,35 +6084,39 @@ init_winsock (int load_now) | |||
| 6092 | 6084 | ||
| 6093 | int h_errno = 0; | 6085 | int h_errno = 0; |
| 6094 | 6086 | ||
| 6095 | /* function to set h_errno for compatibility; map winsock error codes to | 6087 | /* Function to map winsock error codes to errno codes for those errno |
| 6096 | normal system codes where they overlap (non-overlapping definitions | 6088 | code defined in errno.h (errno values not defined by errno.h are |
| 6097 | are already in <sys/socket.h> */ | 6089 | already in nt/inc/sys/socket.h). */ |
| 6098 | static void | 6090 | static void |
| 6099 | set_errno (void) | 6091 | set_errno (void) |
| 6100 | { | 6092 | { |
| 6093 | int wsa_err; | ||
| 6094 | |||
| 6095 | h_errno = 0; | ||
| 6101 | if (winsock_lib == NULL) | 6096 | if (winsock_lib == NULL) |
| 6102 | h_errno = EINVAL; | 6097 | wsa_err = EINVAL; |
| 6103 | else | 6098 | else |
| 6104 | h_errno = pfn_WSAGetLastError (); | 6099 | wsa_err = pfn_WSAGetLastError (); |
| 6105 | 6100 | ||
| 6106 | switch (h_errno) | 6101 | switch (wsa_err) |
| 6107 | { | 6102 | { |
| 6108 | case WSAEACCES: h_errno = EACCES; break; | 6103 | case WSAEACCES: errno = EACCES; break; |
| 6109 | case WSAEBADF: h_errno = EBADF; break; | 6104 | case WSAEBADF: errno = EBADF; break; |
| 6110 | case WSAEFAULT: h_errno = EFAULT; break; | 6105 | case WSAEFAULT: errno = EFAULT; break; |
| 6111 | case WSAEINTR: h_errno = EINTR; break; | 6106 | case WSAEINTR: errno = EINTR; break; |
| 6112 | case WSAEINVAL: h_errno = EINVAL; break; | 6107 | case WSAEINVAL: errno = EINVAL; break; |
| 6113 | case WSAEMFILE: h_errno = EMFILE; break; | 6108 | case WSAEMFILE: errno = EMFILE; break; |
| 6114 | case WSAENAMETOOLONG: h_errno = ENAMETOOLONG; break; | 6109 | case WSAENAMETOOLONG: errno = ENAMETOOLONG; break; |
| 6115 | case WSAENOTEMPTY: h_errno = ENOTEMPTY; break; | 6110 | case WSAENOTEMPTY: errno = ENOTEMPTY; break; |
| 6111 | default: errno = wsa_err; break; | ||
| 6116 | } | 6112 | } |
| 6117 | errno = h_errno; | ||
| 6118 | } | 6113 | } |
| 6119 | 6114 | ||
| 6120 | static void | 6115 | static void |
| 6121 | check_errno (void) | 6116 | check_errno (void) |
| 6122 | { | 6117 | { |
| 6123 | if (h_errno == 0 && winsock_lib != NULL) | 6118 | h_errno = 0; |
| 6119 | if (winsock_lib != NULL) | ||
| 6124 | pfn_WSASetLastError (0); | 6120 | pfn_WSASetLastError (0); |
| 6125 | } | 6121 | } |
| 6126 | 6122 | ||
| @@ -6232,7 +6228,7 @@ sys_socket (int af, int type, int protocol) | |||
| 6232 | 6228 | ||
| 6233 | if (winsock_lib == NULL) | 6229 | if (winsock_lib == NULL) |
| 6234 | { | 6230 | { |
| 6235 | errno = h_errno = ENETDOWN; | 6231 | errno = ENETDOWN; |
| 6236 | return INVALID_SOCKET; | 6232 | return INVALID_SOCKET; |
| 6237 | } | 6233 | } |
| 6238 | 6234 | ||
| @@ -6242,13 +6238,7 @@ sys_socket (int af, int type, int protocol) | |||
| 6242 | s = pfn_socket (af, type, protocol); | 6238 | s = pfn_socket (af, type, protocol); |
| 6243 | 6239 | ||
| 6244 | if (s != INVALID_SOCKET) | 6240 | if (s != INVALID_SOCKET) |
| 6245 | { | 6241 | return socket_to_fd (s); |
| 6246 | int retval = socket_to_fd (s); | ||
| 6247 | |||
| 6248 | if (retval == -1) | ||
| 6249 | errno = h_errno; | ||
| 6250 | return retval; | ||
| 6251 | } | ||
| 6252 | 6242 | ||
| 6253 | set_errno (); | 6243 | set_errno (); |
| 6254 | return -1; | 6244 | return -1; |
| @@ -6344,8 +6334,9 @@ socket_to_fd (SOCKET s) | |||
| 6344 | /* clean up */ | 6334 | /* clean up */ |
| 6345 | _close (fd); | 6335 | _close (fd); |
| 6346 | } | 6336 | } |
| 6337 | else | ||
| 6347 | pfn_closesocket (s); | 6338 | pfn_closesocket (s); |
| 6348 | h_errno = EMFILE; | 6339 | errno = EMFILE; |
| 6349 | return -1; | 6340 | return -1; |
| 6350 | } | 6341 | } |
| 6351 | 6342 | ||
| @@ -6354,7 +6345,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen) | |||
| 6354 | { | 6345 | { |
| 6355 | if (winsock_lib == NULL) | 6346 | if (winsock_lib == NULL) |
| 6356 | { | 6347 | { |
| 6357 | errno = h_errno = ENOTSOCK; | 6348 | errno = ENOTSOCK; |
| 6358 | return SOCKET_ERROR; | 6349 | return SOCKET_ERROR; |
| 6359 | } | 6350 | } |
| 6360 | 6351 | ||
| @@ -6366,7 +6357,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen) | |||
| 6366 | set_errno (); | 6357 | set_errno (); |
| 6367 | return rc; | 6358 | return rc; |
| 6368 | } | 6359 | } |
| 6369 | errno = h_errno = ENOTSOCK; | 6360 | errno = ENOTSOCK; |
| 6370 | return SOCKET_ERROR; | 6361 | return SOCKET_ERROR; |
| 6371 | } | 6362 | } |
| 6372 | 6363 | ||
| @@ -6375,7 +6366,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen) | |||
| 6375 | { | 6366 | { |
| 6376 | if (winsock_lib == NULL) | 6367 | if (winsock_lib == NULL) |
| 6377 | { | 6368 | { |
| 6378 | errno = h_errno = ENOTSOCK; | 6369 | errno = ENOTSOCK; |
| 6379 | return SOCKET_ERROR; | 6370 | return SOCKET_ERROR; |
| 6380 | } | 6371 | } |
| 6381 | 6372 | ||
| @@ -6387,7 +6378,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen) | |||
| 6387 | set_errno (); | 6378 | set_errno (); |
| 6388 | return rc; | 6379 | return rc; |
| 6389 | } | 6380 | } |
| 6390 | errno = h_errno = ENOTSOCK; | 6381 | errno = ENOTSOCK; |
| 6391 | return SOCKET_ERROR; | 6382 | return SOCKET_ERROR; |
| 6392 | } | 6383 | } |
| 6393 | 6384 | ||
| @@ -6416,12 +6407,20 @@ int | |||
| 6416 | sys_gethostname (char * name, int namelen) | 6407 | sys_gethostname (char * name, int namelen) |
| 6417 | { | 6408 | { |
| 6418 | if (winsock_lib != NULL) | 6409 | if (winsock_lib != NULL) |
| 6419 | return pfn_gethostname (name, namelen); | 6410 | { |
| 6411 | int retval; | ||
| 6412 | |||
| 6413 | check_errno (); | ||
| 6414 | retval = pfn_gethostname (name, namelen); | ||
| 6415 | if (retval == SOCKET_ERROR) | ||
| 6416 | set_errno (); | ||
| 6417 | return retval; | ||
| 6418 | } | ||
| 6420 | 6419 | ||
| 6421 | if (namelen > MAX_COMPUTERNAME_LENGTH) | 6420 | if (namelen > MAX_COMPUTERNAME_LENGTH) |
| 6422 | return !GetComputerName (name, (DWORD *)&namelen); | 6421 | return !GetComputerName (name, (DWORD *)&namelen); |
| 6423 | 6422 | ||
| 6424 | errno = h_errno = EFAULT; | 6423 | errno = EFAULT; |
| 6425 | return SOCKET_ERROR; | 6424 | return SOCKET_ERROR; |
| 6426 | } | 6425 | } |
| 6427 | 6426 | ||
| @@ -6429,17 +6428,24 @@ struct hostent * | |||
| 6429 | sys_gethostbyname (const char * name) | 6428 | sys_gethostbyname (const char * name) |
| 6430 | { | 6429 | { |
| 6431 | struct hostent * host; | 6430 | struct hostent * host; |
| 6431 | int h_err = h_errno; | ||
| 6432 | 6432 | ||
| 6433 | if (winsock_lib == NULL) | 6433 | if (winsock_lib == NULL) |
| 6434 | { | 6434 | { |
| 6435 | errno = h_errno = ENETDOWN; | 6435 | h_errno = NO_RECOVERY; |
| 6436 | errno = ENETDOWN; | ||
| 6436 | return NULL; | 6437 | return NULL; |
| 6437 | } | 6438 | } |
| 6438 | 6439 | ||
| 6439 | check_errno (); | 6440 | check_errno (); |
| 6440 | host = pfn_gethostbyname (name); | 6441 | host = pfn_gethostbyname (name); |
| 6441 | if (!host) | 6442 | if (!host) |
| 6442 | set_errno (); | 6443 | { |
| 6444 | set_errno (); | ||
| 6445 | h_errno = errno; | ||
| 6446 | } | ||
| 6447 | else | ||
| 6448 | h_errno = h_err; | ||
| 6443 | return host; | 6449 | return host; |
| 6444 | } | 6450 | } |
| 6445 | 6451 | ||
| @@ -6450,7 +6456,7 @@ sys_getservbyname (const char * name, const char * proto) | |||
| 6450 | 6456 | ||
| 6451 | if (winsock_lib == NULL) | 6457 | if (winsock_lib == NULL) |
| 6452 | { | 6458 | { |
| 6453 | errno = h_errno = ENETDOWN; | 6459 | errno = ENETDOWN; |
| 6454 | return NULL; | 6460 | return NULL; |
| 6455 | } | 6461 | } |
| 6456 | 6462 | ||
| @@ -6466,7 +6472,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen) | |||
| 6466 | { | 6472 | { |
| 6467 | if (winsock_lib == NULL) | 6473 | if (winsock_lib == NULL) |
| 6468 | { | 6474 | { |
| 6469 | errno = h_errno = ENETDOWN; | 6475 | errno = ENETDOWN; |
| 6470 | return SOCKET_ERROR; | 6476 | return SOCKET_ERROR; |
| 6471 | } | 6477 | } |
| 6472 | 6478 | ||
| @@ -6478,7 +6484,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen) | |||
| 6478 | set_errno (); | 6484 | set_errno (); |
| 6479 | return rc; | 6485 | return rc; |
| 6480 | } | 6486 | } |
| 6481 | errno = h_errno = ENOTSOCK; | 6487 | errno = ENOTSOCK; |
| 6482 | return SOCKET_ERROR; | 6488 | return SOCKET_ERROR; |
| 6483 | } | 6489 | } |
| 6484 | 6490 | ||
| @@ -6487,7 +6493,7 @@ sys_shutdown (int s, int how) | |||
| 6487 | { | 6493 | { |
| 6488 | if (winsock_lib == NULL) | 6494 | if (winsock_lib == NULL) |
| 6489 | { | 6495 | { |
| 6490 | errno = h_errno = ENETDOWN; | 6496 | errno = ENETDOWN; |
| 6491 | return SOCKET_ERROR; | 6497 | return SOCKET_ERROR; |
| 6492 | } | 6498 | } |
| 6493 | 6499 | ||
| @@ -6499,7 +6505,7 @@ sys_shutdown (int s, int how) | |||
| 6499 | set_errno (); | 6505 | set_errno (); |
| 6500 | return rc; | 6506 | return rc; |
| 6501 | } | 6507 | } |
| 6502 | errno = h_errno = ENOTSOCK; | 6508 | errno = ENOTSOCK; |
| 6503 | return SOCKET_ERROR; | 6509 | return SOCKET_ERROR; |
| 6504 | } | 6510 | } |
| 6505 | 6511 | ||
| @@ -6508,7 +6514,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) | |||
| 6508 | { | 6514 | { |
| 6509 | if (winsock_lib == NULL) | 6515 | if (winsock_lib == NULL) |
| 6510 | { | 6516 | { |
| 6511 | errno = h_errno = ENETDOWN; | 6517 | errno = ENETDOWN; |
| 6512 | return SOCKET_ERROR; | 6518 | return SOCKET_ERROR; |
| 6513 | } | 6519 | } |
| 6514 | 6520 | ||
| @@ -6521,7 +6527,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) | |||
| 6521 | set_errno (); | 6527 | set_errno (); |
| 6522 | return rc; | 6528 | return rc; |
| 6523 | } | 6529 | } |
| 6524 | errno = h_errno = ENOTSOCK; | 6530 | errno = ENOTSOCK; |
| 6525 | return SOCKET_ERROR; | 6531 | return SOCKET_ERROR; |
| 6526 | } | 6532 | } |
| 6527 | 6533 | ||
| @@ -6530,7 +6536,7 @@ sys_listen (int s, int backlog) | |||
| 6530 | { | 6536 | { |
| 6531 | if (winsock_lib == NULL) | 6537 | if (winsock_lib == NULL) |
| 6532 | { | 6538 | { |
| 6533 | errno = h_errno = ENETDOWN; | 6539 | errno = ENETDOWN; |
| 6534 | return SOCKET_ERROR; | 6540 | return SOCKET_ERROR; |
| 6535 | } | 6541 | } |
| 6536 | 6542 | ||
| @@ -6544,7 +6550,7 @@ sys_listen (int s, int backlog) | |||
| 6544 | fd_info[s].flags |= FILE_LISTEN; | 6550 | fd_info[s].flags |= FILE_LISTEN; |
| 6545 | return rc; | 6551 | return rc; |
| 6546 | } | 6552 | } |
| 6547 | errno = h_errno = ENOTSOCK; | 6553 | errno = ENOTSOCK; |
| 6548 | return SOCKET_ERROR; | 6554 | return SOCKET_ERROR; |
| 6549 | } | 6555 | } |
| 6550 | 6556 | ||
| @@ -6553,7 +6559,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen) | |||
| 6553 | { | 6559 | { |
| 6554 | if (winsock_lib == NULL) | 6560 | if (winsock_lib == NULL) |
| 6555 | { | 6561 | { |
| 6556 | errno = h_errno = ENETDOWN; | 6562 | errno = ENETDOWN; |
| 6557 | return SOCKET_ERROR; | 6563 | return SOCKET_ERROR; |
| 6558 | } | 6564 | } |
| 6559 | 6565 | ||
| @@ -6565,7 +6571,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen) | |||
| 6565 | set_errno (); | 6571 | set_errno (); |
| 6566 | return rc; | 6572 | return rc; |
| 6567 | } | 6573 | } |
| 6568 | errno = h_errno = ENOTSOCK; | 6574 | errno = ENOTSOCK; |
| 6569 | return SOCKET_ERROR; | 6575 | return SOCKET_ERROR; |
| 6570 | } | 6576 | } |
| 6571 | 6577 | ||
| @@ -6574,7 +6580,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6574 | { | 6580 | { |
| 6575 | if (winsock_lib == NULL) | 6581 | if (winsock_lib == NULL) |
| 6576 | { | 6582 | { |
| 6577 | errno = h_errno = ENETDOWN; | 6583 | errno = ENETDOWN; |
| 6578 | return -1; | 6584 | return -1; |
| 6579 | } | 6585 | } |
| 6580 | 6586 | ||
| @@ -6586,11 +6592,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6586 | if (t == INVALID_SOCKET) | 6592 | if (t == INVALID_SOCKET) |
| 6587 | set_errno (); | 6593 | set_errno (); |
| 6588 | else | 6594 | else |
| 6589 | { | 6595 | fd = socket_to_fd (t); |
| 6590 | fd = socket_to_fd (t); | ||
| 6591 | if (fd < 0) | ||
| 6592 | errno = h_errno; /* socket_to_fd sets h_errno */ | ||
| 6593 | } | ||
| 6594 | 6596 | ||
| 6595 | if (fd >= 0) | 6597 | if (fd >= 0) |
| 6596 | { | 6598 | { |
| @@ -6599,7 +6601,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6599 | } | 6601 | } |
| 6600 | return fd; | 6602 | return fd; |
| 6601 | } | 6603 | } |
| 6602 | errno = h_errno = ENOTSOCK; | 6604 | errno = ENOTSOCK; |
| 6603 | return -1; | 6605 | return -1; |
| 6604 | } | 6606 | } |
| 6605 | 6607 | ||
| @@ -6609,7 +6611,7 @@ sys_recvfrom (int s, char * buf, int len, int flags, | |||
| 6609 | { | 6611 | { |
| 6610 | if (winsock_lib == NULL) | 6612 | if (winsock_lib == NULL) |
| 6611 | { | 6613 | { |
| 6612 | errno = h_errno = ENETDOWN; | 6614 | errno = ENETDOWN; |
| 6613 | return SOCKET_ERROR; | 6615 | return SOCKET_ERROR; |
| 6614 | } | 6616 | } |
| 6615 | 6617 | ||
| @@ -6621,7 +6623,7 @@ sys_recvfrom (int s, char * buf, int len, int flags, | |||
| 6621 | set_errno (); | 6623 | set_errno (); |
| 6622 | return rc; | 6624 | return rc; |
| 6623 | } | 6625 | } |
| 6624 | errno = h_errno = ENOTSOCK; | 6626 | errno = ENOTSOCK; |
| 6625 | return SOCKET_ERROR; | 6627 | return SOCKET_ERROR; |
| 6626 | } | 6628 | } |
| 6627 | 6629 | ||
| @@ -6631,7 +6633,7 @@ sys_sendto (int s, const char * buf, int len, int flags, | |||
| 6631 | { | 6633 | { |
| 6632 | if (winsock_lib == NULL) | 6634 | if (winsock_lib == NULL) |
| 6633 | { | 6635 | { |
| 6634 | errno = h_errno = ENETDOWN; | 6636 | errno = ENETDOWN; |
| 6635 | return SOCKET_ERROR; | 6637 | return SOCKET_ERROR; |
| 6636 | } | 6638 | } |
| 6637 | 6639 | ||
| @@ -6643,7 +6645,7 @@ sys_sendto (int s, const char * buf, int len, int flags, | |||
| 6643 | set_errno (); | 6645 | set_errno (); |
| 6644 | return rc; | 6646 | return rc; |
| 6645 | } | 6647 | } |
| 6646 | errno = h_errno = ENOTSOCK; | 6648 | errno = ENOTSOCK; |
| 6647 | return SOCKET_ERROR; | 6649 | return SOCKET_ERROR; |
| 6648 | } | 6650 | } |
| 6649 | 6651 | ||
| @@ -6654,7 +6656,7 @@ fcntl (int s, int cmd, int options) | |||
| 6654 | { | 6656 | { |
| 6655 | if (winsock_lib == NULL) | 6657 | if (winsock_lib == NULL) |
| 6656 | { | 6658 | { |
| 6657 | errno = h_errno = ENETDOWN; | 6659 | errno = ENETDOWN; |
| 6658 | return -1; | 6660 | return -1; |
| 6659 | } | 6661 | } |
| 6660 | 6662 | ||
| @@ -6673,11 +6675,11 @@ fcntl (int s, int cmd, int options) | |||
| 6673 | } | 6675 | } |
| 6674 | else | 6676 | else |
| 6675 | { | 6677 | { |
| 6676 | h_errno = EINVAL; | 6678 | errno = EINVAL; |
| 6677 | return SOCKET_ERROR; | 6679 | return SOCKET_ERROR; |
| 6678 | } | 6680 | } |
| 6679 | } | 6681 | } |
| 6680 | errno = h_errno = ENOTSOCK; | 6682 | errno = ENOTSOCK; |
| 6681 | return SOCKET_ERROR; | 6683 | return SOCKET_ERROR; |
| 6682 | } | 6684 | } |
| 6683 | 6685 | ||
| @@ -7108,7 +7110,7 @@ sys_read (int fd, char * buffer, unsigned int count) | |||
| 7108 | pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); | 7110 | pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); |
| 7109 | if (waiting == 0 && nchars == 0) | 7111 | if (waiting == 0 && nchars == 0) |
| 7110 | { | 7112 | { |
| 7111 | h_errno = errno = EWOULDBLOCK; | 7113 | errno = EWOULDBLOCK; |
| 7112 | return -1; | 7114 | return -1; |
| 7113 | } | 7115 | } |
| 7114 | 7116 | ||
diff --git a/src/w32term.c b/src/w32term.c index c83ee31d200..170f33ecd67 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -191,11 +191,7 @@ static Time last_mouse_movement_time; | |||
| 191 | 191 | ||
| 192 | /* Incremented by w32_read_socket whenever it really tries to read | 192 | /* Incremented by w32_read_socket whenever it really tries to read |
| 193 | events. */ | 193 | events. */ |
| 194 | #ifdef __STDC__ | ||
| 195 | static int volatile input_signal_count; | 194 | static int volatile input_signal_count; |
| 196 | #else | ||
| 197 | static int input_signal_count; | ||
| 198 | #endif | ||
| 199 | 195 | ||
| 200 | #ifdef CYGWIN | 196 | #ifdef CYGWIN |
| 201 | int w32_message_fd = -1; | 197 | int w32_message_fd = -1; |