Ignore:
Timestamp:
Aug 2, 2007, 11:33:40 PM (15 years ago)
Author:
charles
Message:

More win32 portability fixes. we now talk to tracker & peers; hash checks work, downloads seem to work. w00t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r2593 r2596  
    430430    char path[MAX_PATH_LENGTH];
    431431    int ret;
     432    int flags;
    432433
    433434    tr_dbg( "Opening %s in %s (%d)", name, folder, write );
     
    449450        char * s;
    450451
    451         while( ( s = strchr( p, '/' ) ) )
     452        while( ( s = strchr( p, TR_PATH_DELIMITER ) ) )
    452453        {
    453454            *s = '\0';
     
    469470                }
    470471            }
    471             *s = '/';
     472            *s = TR_PATH_DELIMITER;
    472473            p = s + 1;
    473474        }
     
    476477    /* Now try to really open the file */
    477478    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 );
    479485    if( write && ( file->file < 0 ) )
    480486    {
Note: See TracChangeset for help on using the changeset viewer.