Changeset 79b77ce in mainline for uspace/lib/fmgt/src/copy.c
- Timestamp:
- 2025-12-17T00:00:01Z (3 weeks ago)
- Branches:
- master
- Children:
- 81805e0
- Parents:
- 2309891
- File:
-
- 1 edited
-
uspace/lib/fmgt/src/copy.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fmgt/src/copy.c
r2309891 r79b77ce 97 97 { 98 98 fmgt_t *fmgt = (fmgt_t *)arg; 99 errno_t rc; 100 101 rc = vfs_link_path(dest, KIND_DIRECTORY, NULL); 102 103 /* It is okay if the directory exists. */ 104 if (rc != EOK && rc != EEXIST) 105 return rc; // XXX error recovery? 106 107 (void)fmgt; 108 return EOK; 99 fmgt_io_error_t err; 100 fmgt_error_action_t action; 101 errno_t rc; 102 103 do { 104 rc = vfs_link_path(dest, KIND_DIRECTORY, NULL); 105 106 /* It is okay if the directory exists. */ 107 if (rc == EOK || rc == EEXIST) 108 break; 109 110 /* I/O error */ 111 err.fname = dest; 112 err.optype = fmgt_io_create; 113 err.rc = rc; 114 115 fmgt_timer_stop(fmgt); 116 action = fmgt_io_error_query(fmgt, &err); 117 fmgt_timer_start(fmgt); 118 } while (action == fmgt_er_retry); 119 120 return rc; 109 121 } 110 122 … … 133 145 return ENOMEM; 134 146 135 rc = vfs_lookup_open(src, WALK_REGULAR, MODE_READ, &rfd); 147 do { 148 rc = vfs_lookup_open(src, WALK_REGULAR, MODE_READ, &rfd); 149 if (rc == EOK) 150 break; 151 152 /* I/O error */ 153 err.fname = src; 154 err.optype = fmgt_io_open; 155 err.rc = rc; 156 fmgt_timer_stop(fmgt); 157 action = fmgt_io_error_query(fmgt, &err); 158 fmgt_timer_start(fmgt); 159 } while (action == fmgt_er_retry); 160 161 /* Not recovered? */ 136 162 if (rc != EOK) { 137 163 free(buffer); 138 return rc; // XXX error recovery?164 return rc; 139 165 } 140 166 141 rc = vfs_lookup_open(dest, WALK_REGULAR | WALK_MAY_CREATE, MODE_WRITE, 142 &wfd); 167 do { 168 rc = vfs_lookup_open(dest, WALK_REGULAR | WALK_MAY_CREATE, 169 MODE_WRITE, &wfd); 170 if (rc == EOK) 171 break; 172 173 /* I/O error */ 174 err.fname = dest; 175 err.optype = fmgt_io_create; 176 err.rc = rc; 177 fmgt_timer_stop(fmgt); 178 action = fmgt_io_error_query(fmgt, &err); 179 fmgt_timer_start(fmgt); 180 } while (action == fmgt_er_retry); 181 143 182 if (rc != EOK) { 144 183 free(buffer);
Note:
See TracChangeset
for help on using the changeset viewer.
