Changeset 177

Show
Ignore:
Timestamp:
07/11/07 19:55:59 (17 months ago)
Author:
zany
Message:

binary file mode on win32

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/obexftp/client.c

    r160 r177  
    4242#include <winsock2.h> 
    4343#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT 
    44 #define S_IRGRP 0 
    45 #define S_IROTH 0 
     44#define O_BINARY (_O_BINARY) 
     45#define CREATE_MODE_FILE (S_IRUSR|S_IWUSR) 
    4646#else 
    4747#include <sys/socket.h> 
    4848#include <arpa/inet.h> 
    4949#include <netinet/in.h> 
     50#define O_BINARY (0) 
     51#define CREATE_MODE_FILE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) 
    5052#endif /* _WIN32 */ 
    5153 
     
    362364                                int fd; 
    363365                                //fd = open_safe("", cli-> target_fn); 
    364                                 fd = creat(cli-> target_fn, 
    365                                            S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); 
     366                                fd = creat(cli-> target_fn, CREATE_MODE_FILE); 
    366367                                if(fd > 0) { 
    367368                                        (void) write(fd, body_data, body_len); 
     
    987988        } 
    988989         
    989         cli->fd = open(filename, O_RDONLY, 0); 
     990        cli->fd = open(filename, O_RDONLY | O_BINARY, 0); 
    990991        if(cli->fd < 0) 
    991992                ret = -1;