Develop and Download Open Source Software

Browse Subversion Repository

Diff of /tags/REL-2.2/ftp_rmdir.c

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

revision 22 by hirohitohigashi, Fri Feb 27 14:14:33 2009 UTC revision 29 by hirohitohigashi, Sat Feb 28 12:48:31 2009 UTC
# Line 38  Line 38 
38  int ftp_rmdir( LIBOFTP *ftp, const char *dirname )  int ftp_rmdir( LIBOFTP *ftp, const char *dirname )
39  {  {
40      char str1[512];      char str1[512];
41      int ret;      int res;
42    
43      /*      /*
44       * send RMD command       * send RMD command
45       */       */
46      snprintf( str1, sizeof(str1)-1, "RMD %s\r\n", dirname );      snprintf( str1, sizeof(str1)-1, "RMD %s\r\n", dirname );
47      if( ftp_send_command( ftp, str1 ) < 0 ) {      if( ftp_send_command( ftp, str1 ) < 0 ) {
48          DEBUGPRINT1( "rmdir: command sending error. %s\n", str1 );          DEBUGPRINT1( "command sending error. %s\n", str1 );
49          return -1;          return LIBOFTP_ERROR_OS;
50      }      }
51    
52      if( (ret = ftp_receive_response( ftp, str1, sizeof(str1) )) != 250 ) {      /* 250: Requested file action okay, completed. */      res = ftp_receive_response( ftp, ftp->error_message, sizeof(ftp->error_message)-1 );
53          DEBUGPRINT1( "rmdir: command response error. %d\n", ret );      if( res != 250 ) {                                          /* 250: Requested file action okay, completed. */
54          return -2;          DEBUGPRINT1( "command response error. %d\n", res );
55            return res < 0? res: LIBOFTP_ERROR_PROTOCOL;
56      }      }
57    
58      return 0;      return LIBOFTP_NOERROR;
59  }  }

Legend:
Removed from v.22  
changed lines
  Added in v.29

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