use do_open() instead of open() in several places to help the WinXX port
authorAndrew Tridgell <tridge@samba.org>
Mon, 25 Oct 1999 22:04:09 +0000 (22:04 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 25 Oct 1999 22:04:09 +0000 (22:04 +0000)
and O_BINARY

checksum.c
generator.c
receiver.c
sender.c
util.c

index 194d899a3f8b596e25567fa9542718fb314ff8b7..0ce7259dbf32d56fa4c6b76efb2f3d14555cd191 100644 (file)
@@ -93,7 +93,7 @@ void file_checksum(char *fname,char *sum,OFF_T size)
        
        memset(sum,0,MD4_SUM_LENGTH);
        
-       fd = open(fname,O_RDONLY);
+       fd = do_open(fname, O_RDONLY, 0);
        if (fd == -1) return;
        
        buf = map_file(fd,size);
index bbc328df498099872af404b7b5d1542a1d9a37fd..8afc8f72c1adea73f3fca937573c6e33edca7658 100644 (file)
@@ -340,7 +340,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
        }
 
        /* open the file */  
-       fd = open(fnamecmp,O_RDONLY);
+       fd = do_open(fnamecmp, O_RDONLY, 0);
 
        if (fd == -1) {
                rprintf(FERROR,"failed to open %s : %s\n",fnamecmp,strerror(errno));
index 6361d21b43f4081beb83dae7d2dd24e01cb043e6..6eb9acab044969aff2bc377d283540c7841f1aeb 100644 (file)
@@ -358,14 +358,14 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
                fnamecmp = fname;
 
                /* open the file */  
-               fd1 = open(fnamecmp,O_RDONLY);
+               fd1 = do_open(fnamecmp, O_RDONLY, 0);
 
                if ((fd1 == -1) && (compare_dest != NULL)) {
                        /* try the file at compare_dest instead */
                        slprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s",
                                                compare_dest,fname);
                        fnamecmp = fnamecmpbuf;
-                       fd1 = open(fnamecmp,O_RDONLY);
+                       fd1 = do_open(fnamecmp, O_RDONLY, 0);
                }
 
                if (fd1 != -1 && do_fstat(fd1,&st) != 0) {
index 623d995d5a701ad7c83acb082dd046619200dc6b..3a443468b1a822da6890936598bbae1aaf933d2f 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -160,7 +160,7 @@ void send_files(struct file_list *flist,int f_out,int f_in)
                        return;
                }
          
-               fd = open(fname,O_RDONLY);
+               fd = do_open(fname, O_RDONLY, 0);
                if (fd == -1) {
                        io_error = 1;
                        rprintf(FERROR,"send_files failed to open %s: %s\n",
diff --git a/util.c b/util.c
index 2d1989d42f02407a4e7fd390e99a4ddf54f95fd5..947caa7ce3a5fe6fc17cb9f3b596780e0dac284c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -282,7 +282,7 @@ int copy_file(char *source, char *dest, mode_t mode)
        char buf[1024 * 8];
        int len;   /* Number of bytes read into `buf'. */
 
-       ifd = open(source, O_RDONLY);
+       ifd = do_open(source, O_RDONLY, 0);
        if (ifd == -1) {
                rprintf(FERROR,"open %s: %s\n",
                        source,strerror(errno));