Changeset 2596
- Timestamp:
- Aug 2, 2007, 11:33:40 PM (15 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/fastresume.c
r2573 r2596 168 168 169 169 fastResumeFileName( path, sizeof path, tor, 1 ); 170 file = fopen( path, "w " );170 file = fopen( path, "wb" ); 171 171 if( NULL == file ) { 172 172 tr_err( "Couldn't open '%s' for writing", path ); … … 469 469 /* Open resume file */ 470 470 fastResumeFileName( path, sizeof path, tor, 1 ); 471 file = fopen( path, "r " );471 file = fopen( path, "rb" ); 472 472 if( !file ) 473 473 { … … 475 475 { 476 476 fastResumeFileName( path, sizeof path, tor, 0 ); 477 file = fopen( path, "r " );477 file = fopen( path, "rb" ); 478 478 if( !file ) 479 479 { -
trunk/libtransmission/fdlimit.c
r2593 r2596 430 430 char path[MAX_PATH_LENGTH]; 431 431 int ret; 432 int flags; 432 433 433 434 tr_dbg( "Opening %s in %s (%d)", name, folder, write ); … … 449 450 char * s; 450 451 451 while( ( s = strchr( p, '/') ) )452 while( ( s = strchr( p, TR_PATH_DELIMITER ) ) ) 452 453 { 453 454 *s = '\0'; … … 469 470 } 470 471 } 471 *s = '/';472 *s = TR_PATH_DELIMITER; 472 473 p = s + 1; 473 474 } … … 476 477 /* Now try to really open the file */ 477 478 errno = 0; 478 file->file = open( path, write ? ( O_RDWR | O_CREAT ) : O_RDONLY, 0666 ); 479 flags = 0; 480 #ifdef WIN32 481 flags |= O_BINARY; 482 #endif 483 flags |= write ? (O_RDWR | O_CREAT) : O_RDONLY; 484 file->file = open( path, flags, 0666 ); 479 485 if( write && ( file->file < 0 ) ) 480 486 { -
trunk/libtransmission/net.c
r2593 r2596 307 307 sock.sin_port = port; 308 308 309 if( connect( s, (struct sockaddr *) &sock, 310 sizeof( struct sockaddr_in ) ) < 0 && 311 sockerrno != EINPROGRESS ) 309 if( ( connect( s, (struct sockaddr *) &sock, 310 sizeof( struct sockaddr_in ) ) < 0 ) 311 #ifdef WIN32 312 && ( sockerrno != WSAEWOULDBLOCK ) 313 #endif 314 && ( sockerrno != EINPROGRESS ) ) 312 315 { 313 316 tr_err( "Couldn't connect socket (%s)", strerror( sockerrno ) ); -
trunk/libtransmission/platform.c
r2591 r2596 749 749 { 750 750 tr_err( "sysctl net.route.0.inet.flags.gateway failed (%s)", 751 strerror( errno ) );751 strerror( sockerrno ) ); 752 752 } 753 753 *buflen = 0; … … 765 765 { 766 766 tr_err( "sysctl net.route.0.inet.flags.gateway failed (%s)", 767 strerror( errno ) );767 strerror( sockerrno ) ); 768 768 free( buf ); 769 769 *buflen = 0; … … 895 895 if( 0 > fd ) 896 896 { 897 tr_err( "failed to create routing socket (%s)", strerror( errno ) );897 tr_err( "failed to create routing socket (%s)", strerror( sockerrno ) ); 898 898 return -1; 899 899 } … … 902 902 if( 0 > flags || 0 > fcntl( fd, F_SETFL, O_NONBLOCK | flags ) ) 903 903 { 904 tr_err( "failed to set socket nonblocking (%s)", strerror( errno ) );904 tr_err( "failed to set socket nonblocking (%s)", strerror( sockerrno ) ); 905 905 close( fd ); 906 906 return -1; … … 921 921 (struct sockaddr *) &snl, sizeof( snl ) ) ) 922 922 { 923 tr_err( "failed to write to routing socket (%s)", strerror( errno ) );923 tr_err( "failed to write to routing socket (%s)", strerror( sockerrno ) ); 924 924 close( fd ); 925 925 return -1; -
trunk/libtransmission/utils.c
r2591 r2596 49 49 static tr_lock_t * messageLock = NULL; 50 50 static int messageLevel = 0; 51 static int messageQueuing = 0;51 static int messageQueuing = FALSE; 52 52 static tr_msg_list_t * messageQueue = NULL; 53 53 static tr_msg_list_t ** messageQueueTail = &messageQueue; … … 161 161 vfprintf( stderr, msg, args1 ); 162 162 fputc( '\n', stderr ); 163 fflush( stderr ); 163 164 } 164 165 va_end( args1 );
Note: See TracChangeset
for help on using the changeset viewer.