changeset 817:cfa4ec2fb98f

2006-9-26 Brian Masney <masneyb@gftp.org> * lib/protocols.c (gftp_fd_read, gftp_fd_write) - make sure the return value properly matches what was actually read or written to the socket
author masneyb
date Tue, 26 Sep 2006 11:26:31 +0000
parents 214d7e6ea78b
children 42a92d671a0d
files ChangeLog lib/protocols.c
diffstat 2 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Sep 26 10:56:33 2006 +0000
+++ b/ChangeLog	Tue Sep 26 11:26:31 2006 +0000
@@ -1,4 +1,7 @@
 2006-9-26 Brian Masney <masneyb@gftp.org>
+	* lib/protocols.c (gftp_fd_read, gftp_fd_write) - make sure the return
+	value properly matches what was actually read or written to the socket
+
 	* lib/rfc959.c - added rfc959_close_data_connection()
 
 2006-9-15 Brian Masney <masneyb@gftp.org>
@@ -3584,7 +3587,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.474 2006/09/26 10:56:33 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.475 2006/09/26 11:26:31 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/protocols.c	Tue Sep 26 10:56:33 2006 +0000
+++ b/lib/protocols.c	Tue Sep 26 11:26:31 2006 +0000
@@ -2662,6 +2662,7 @@
   struct timeval tv;
   fd_set fset;
   ssize_t ret;
+  int s_ret;
 
   g_return_val_if_fail (fd >= 0, GFTP_EFATAL);
 
@@ -2676,8 +2677,8 @@
       FD_SET (fd, &fset);
       tv.tv_sec = network_timeout;
       tv.tv_usec = 0;
-      ret = select (fd + 1, &fset, NULL, NULL, &tv);
-      if (ret == -1 && (errno == EINTR || errno == EAGAIN))
+      s_ret = select (fd + 1, &fset, NULL, NULL, &tv);
+      if (s_ret == -1 && (errno == EINTR || errno == EAGAIN))
         {
           if (request != NULL && request->cancel)
             {
@@ -2687,7 +2688,7 @@
 
           continue;
         }
-      else if (ret <= 0)
+      else if (s_ret <= 0)
         {
           if (request != NULL)
             {
@@ -2737,9 +2738,9 @@
 {
   intptr_t network_timeout;
   struct timeval tv;
+  int ret, s_ret;
   ssize_t w_ret;
   fd_set fset;
-  int ret;
 
   g_return_val_if_fail (fd >= 0, GFTP_EFATAL);
 
@@ -2753,8 +2754,8 @@
       FD_SET (fd, &fset);
       tv.tv_sec = network_timeout;
       tv.tv_usec = 0;
-      ret = select (fd + 1, NULL, &fset, NULL, &tv);
-      if (ret == -1 && (errno == EINTR || errno == EAGAIN))
+      s_ret = select (fd + 1, NULL, &fset, NULL, &tv);
+      if (s_ret == -1 && (errno == EINTR || errno == EAGAIN))
         {
           if (request != NULL && request->cancel)
             {
@@ -2764,7 +2765,7 @@
 
           continue;
         }
-      else if (ret <= 0)
+      else if (s_ret <= 0)
         {
           if (request != NULL)
             {