Commit 8c9fd200 authored by Andrew Tridgell's avatar Andrew Tridgell

use do_open() instead of open() in several places to help the WinXX port

and O_BINARY
parent 79f118d8
...@@ -93,7 +93,7 @@ void file_checksum(char *fname,char *sum,OFF_T size) ...@@ -93,7 +93,7 @@ void file_checksum(char *fname,char *sum,OFF_T size)
memset(sum,0,MD4_SUM_LENGTH); memset(sum,0,MD4_SUM_LENGTH);
fd = open(fname,O_RDONLY); fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) return; if (fd == -1) return;
buf = map_file(fd,size); buf = map_file(fd,size);
......
...@@ -340,7 +340,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out) ...@@ -340,7 +340,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
} }
/* open the file */ /* open the file */
fd = open(fnamecmp,O_RDONLY); fd = do_open(fnamecmp, O_RDONLY, 0);
if (fd == -1) { if (fd == -1) {
rprintf(FERROR,"failed to open %s : %s\n",fnamecmp,strerror(errno)); rprintf(FERROR,"failed to open %s : %s\n",fnamecmp,strerror(errno));
......
...@@ -358,14 +358,14 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen) ...@@ -358,14 +358,14 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
fnamecmp = fname; fnamecmp = fname;
/* open the file */ /* open the file */
fd1 = open(fnamecmp,O_RDONLY); fd1 = do_open(fnamecmp, O_RDONLY, 0);
if ((fd1 == -1) && (compare_dest != NULL)) { if ((fd1 == -1) && (compare_dest != NULL)) {
/* try the file at compare_dest instead */ /* try the file at compare_dest instead */
slprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s", slprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s",
compare_dest,fname); compare_dest,fname);
fnamecmp = fnamecmpbuf; fnamecmp = fnamecmpbuf;
fd1 = open(fnamecmp,O_RDONLY); fd1 = do_open(fnamecmp, O_RDONLY, 0);
} }
if (fd1 != -1 && do_fstat(fd1,&st) != 0) { if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
......
...@@ -160,7 +160,7 @@ void send_files(struct file_list *flist,int f_out,int f_in) ...@@ -160,7 +160,7 @@ void send_files(struct file_list *flist,int f_out,int f_in)
return; return;
} }
fd = open(fname,O_RDONLY); fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) { if (fd == -1) {
io_error = 1; io_error = 1;
rprintf(FERROR,"send_files failed to open %s: %s\n", rprintf(FERROR,"send_files failed to open %s: %s\n",
......
...@@ -282,7 +282,7 @@ int copy_file(char *source, char *dest, mode_t mode) ...@@ -282,7 +282,7 @@ int copy_file(char *source, char *dest, mode_t mode)
char buf[1024 * 8]; char buf[1024 * 8];
int len; /* Number of bytes read into `buf'. */ int len; /* Number of bytes read into `buf'. */
ifd = open(source, O_RDONLY); ifd = do_open(source, O_RDONLY, 0);
if (ifd == -1) { if (ifd == -1) {
rprintf(FERROR,"open %s: %s\n", rprintf(FERROR,"open %s: %s\n",
source,strerror(errno)); source,strerror(errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment