Changeset 59ed424e in mainline for uspace/lib/fmgt/src/copy.c
- Timestamp:
- 2026-02-11T12:02:03Z (30 hours ago)
- Branches:
- master
- Children:
- f9c30b9a
- Parents:
- 857fba8
- git-author:
- Jiri Svoboda <jiri@…> (2026-02-10 20:01:03)
- git-committer:
- Jiri Svoboda <jiri@…> (2026-02-11 12:02:03)
- File:
-
- 1 edited
-
uspace/lib/fmgt/src/copy.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fmgt/src/copy.c
r857fba8 r59ed424e 43 43 #include "../private/fsops.h" 44 44 45 static errno_t fmgt_copy_dir_enter( void*, const char *, const char *);46 static errno_t fmgt_copy_file( void*, const char *, const char *);45 static errno_t fmgt_copy_dir_enter(fmgt_walk_t *, const char *, const char *); 46 static errno_t fmgt_copy_file(fmgt_walk_t *, const char *, const char *); 47 47 48 48 static fmgt_walk_cb_t fmgt_copy_cb = { … … 53 53 /** Copy operation - enter directory. 54 54 * 55 * @param arg Argument (fmgt_t *)55 * @param walk Walk 56 56 * @param fname Source directory name 57 57 * @param dest Destination directory name 58 58 * @return EOK on success or an error code 59 59 */ 60 static errno_t fmgt_copy_dir_enter(void *arg, const char *src, const char *dest) 60 static errno_t fmgt_copy_dir_enter(fmgt_walk_t *walk, const char *src, 61 const char *dest) 61 62 { 62 fmgt_t *fmgt = (fmgt_t *) arg;63 fmgt_t *fmgt = (fmgt_t *)walk->params->arg; 63 64 64 65 (void)dest; … … 68 69 /** Copy single file. 69 70 * 70 * @param arg Argument (fmgt_t *)71 * @param walk Walk 71 72 * @param fname Source file name 72 73 * @param dest Destination file name 73 74 * @return EOK on success or an error code 74 75 */ 75 static errno_t fmgt_copy_file(void *arg, const char *src, const char *dest) 76 static errno_t fmgt_copy_file(fmgt_walk_t *walk, const char *src, 77 const char *dest) 76 78 { 77 fmgt_t *fmgt = (fmgt_t *)arg; 79 fmgt_t *fmgt = (fmgt_t *)walk->params->arg; 80 fmgt_exists_action_t exaction; 78 81 int rfd; 79 82 int wfd; … … 82 85 aoff64_t wpos = 0; 83 86 char *buffer; 84 bool skip;85 87 errno_t rc; 86 88 … … 95 97 } 96 98 97 rc = fmgt_create_file(fmgt, dest, &wfd, & skip);99 rc = fmgt_create_file(fmgt, dest, &wfd, &exaction); 98 100 if (rc != EOK) { 99 101 free(buffer); 100 102 vfs_put(rfd); 101 103 102 /* User decided to skip and continue. */ 103 if (rc == EEXIST && skip) 104 if (rc == EEXIST && exaction != fmgt_exr_fail) { 105 if (exaction == fmgt_exr_abort) 106 walk->stop = true; 104 107 return EOK; 108 } 109 105 110 return rc; 106 111 }
Note:
See TracChangeset
for help on using the changeset viewer.
