com php-src: use _set_errno where appropriate: ext/ ftp/ftp.c
| From: | Anatol Belski | Date: | Thu, 12 Mar 2015 15:24:56 +0000 |
| Subject: | com php-src: use _set_errno where appropriate: ext/ ftp/ftp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85484@lists.php.net to get a copy of this message | ||
Commit: 1cf70266e77cf5810f46a3282b03e7ae0f45c23a
Author: Anatol Belski <ab@php.net> Thu, 12 Mar 2015 16:24:56 +0100
Parents: 931f116bbdf2e83ee23245fff069527584026bd5
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1cf70266e77cf5810f46a3282b03e7ae0f45c23a
Log:
use _set_errno where appropriate
Changed paths:
M ext/ftp/ftp.c
Diff:
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 970ba8f..9c0c921 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -1262,8 +1262,11 @@ my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
n = php_pollfd_for_ms(s, POLLOUT, ftp->timeout_sec * 1000);
if (n < 1) {
-
-#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
+#ifdef PHP_WIN32
+ if (n == 0) {
+ _set_errno(ETIMEDOUT);
+ }
+#elif !(defined(NETWARE) && defined(USE_WINSOCK))
if (n == 0) {
errno = ETIMEDOUT;
}
@@ -1303,7 +1306,11 @@ my_recv(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000);
if (n < 1) {
-#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
+#ifdef PHP_WIN32
+ if (n == 0) {
+ _set_errno(ETIMEDOUT);
+ }
+#elif !(defined(NETWARE) && defined(USE_WINSOCK))
if (n == 0) {
errno = ETIMEDOUT;
}
@@ -1335,7 +1342,11 @@ data_available(ftpbuf_t *ftp, php_socket_t s)
n = php_pollfd_for_ms(s, PHP_POLLREADABLE, 1000);
if (n < 1) {
-#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
+#ifdef PHP_WIN32
+ if (n == 0) {
+ _set_errno(ETIMEDOUT);
+ }
+#elif !(defined(NETWARE) && defined(USE_WINSOCK))
if (n == 0) {
errno = ETIMEDOUT;
}
@@ -1355,7 +1366,11 @@ data_writeable(ftpbuf_t *ftp, php_socket_t s)
n = php_pollfd_for_ms(s, POLLOUT, 1000);
if (n < 1) {
-#ifndef PHP_WIN32
+#ifdef PHP_WIN32
+ if (n == 0) {
+ _set_errno(ETIMEDOUT);
+ }
+#elif !(defined(NETWARE) && defined(USE_WINSOCK))
if (n == 0) {
errno = ETIMEDOUT;
}
@@ -1376,7 +1391,11 @@ my_accept(ftpbuf_t *ftp, php_socket_t s, struct sockaddr *addr, socklen_t
*addrl
n = php_pollfd_for_ms(s, PHP_POLLREADABLE, ftp->timeout_sec * 1000);
if (n < 1) {
-#if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK))
+#ifdef PHP_WIN32
+ if (n == 0) {
+ _set_errno(ETIMEDOUT);
+ }
+#elif !(defined(NETWARE) && defined(USE_WINSOCK))
if (n == 0) {
errno = ETIMEDOUT;
}