Changeset 1309 in kBuild for trunk/src/kmk/kmkbuiltin/cp_utils.c
- Timestamp:
- Dec 2, 2007 4:53:40 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/cp_utils.c
r1192 r1309 54 54 #include <sysexits.h> 55 55 #include <unistd.h> 56 57 56 #ifdef __sun__ 58 57 # include "solfakes.h" 59 58 #endif 60 59 #ifdef _MSC_VER 60 # define MSC_DO_64_BIT_IO 61 61 # include "mscfakes.h" 62 62 #endif 63 64 63 #include "cp_extern.h" 64 #include "cmp_extern.h" 65 65 66 #define cp_pct(x,y) (int)(100.0 * (double)(x) / (double)(y)) 66 67 … … 76 77 #endif 77 78 78 int 79 copy_file(const FTSENT *entp, int dne) 79 80 int 81 copy_file(const FTSENT *entp, int dne, int changed_only, int *pcopied) 80 82 { 81 83 static char buf[MAXBSIZE]; … … 90 92 #endif 91 93 94 *pcopied = 0; 95 92 96 if ((from_fd = open(entp->fts_path, O_RDONLY | O_BINARY, 0)) == -1) { 93 97 warn("%s", entp->fts_path); … … 106 110 */ 107 111 if (!dne) { 112 /* compare the files first if requested */ 113 if ( changed_only 114 && cmp_fd_and_file(from_fd, entp->fts_path, to.p_path, 115 1 /* silent */, 0 /* lflag */, 116 0 /* special */) 117 == OK_EXIT) { 118 return (0); 119 } 120 108 121 #define YESNO "(y/n [n]) " 109 122 if (nflag) { … … 144 157 145 158 rval = 0; 159 *pcopied = 1; 146 160 147 161 /*
Note:
See TracChangeset
for help on using the changeset viewer.