Develop and Download Open Source Software

Browse Subversion Repository

Diff of /branches/RB-1.1/ftpget.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8 by hirohitohigashi, Fri Feb 20 14:38:01 2009 UTC revision 9 by hirohitohigashi, Sat Feb 21 15:28:08 2009 UTC
# Line 174  int ftp_get (int sck, char *FileName, in Line 174  int ftp_get (int sck, char *FileName, in
174    
175      ftp_connection.sin_port = htons(data_port);      ftp_connection.sin_port = htons(data_port);
176    
     if ( (flags=fcntl(sock, F_GETFL,0)) < 0) {  
         printf("--[ fcntl get flags error.\n");  
         exit(1);  
     }  
   
     flags |= O_NONBLOCK;  
   
     if ( fcntl (sock, F_SETFL, flags ) < 0 ) {  
         printf("--[ Non Blocking Socket Error.\n");  
         exit(1);  
     }  
   
177    
178      if ( (con_err = connect(sock, (struct sockaddr *)&ftp_connection, sizeof(struct sockaddr)) ) != 0)  {      if ( (con_err = connect(sock, (struct sockaddr *)&ftp_connection, sizeof(struct sockaddr)) ) != 0)  {
179          if (con_err == ECONNREFUSED) {          if (con_err == ECONNREFUSED) {
# Line 204  int ftp_get (int sck, char *FileName, in Line 192  int ftp_get (int sck, char *FileName, in
192          return -1;          return -1;
193      }      }
194    
195        if ( (flags=fcntl(sock, F_GETFL,0)) < 0) {
196            printf("--[ fcntl get flags error.\n");
197            exit(1);
198        }
199    
200        flags |= O_NONBLOCK;
201    
202        if ( fcntl (sock, F_SETFL, flags ) < 0 ) {
203            printf("--[ Non Blocking Socket Error.\n");
204            exit(1);
205        }
206    
207      buff[4095] = '\0';      buff[4095] = '\0';
208    

Legend:
Removed from v.8  
changed lines
  Added in v.9

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26