Changeset b017885 in mainline
- Timestamp:
- 2026-03-17T12:37:41Z (22 hours ago)
- Children:
- 74c69dc
- Parents:
- 7952b336
- git-author:
- Vít Skalický <skalicky@…> (2026-03-17 12:16:27)
- git-committer:
- Vít Skalický <skalicky@…> (2026-03-17 12:37:41)
- File:
-
- 1 edited
-
uspace/app/cmpdirs/cmpdirs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/cmpdirs/cmpdirs.c
r7952b336 rb017885 334 334 assert(rc != EOK); 335 335 } 336 check_ok(rc, close_inner, "Failed to open directory (handle %d", item.handle1);336 check_ok(rc, close_inner, "Failed to open directory of handle %d", item.handle1); 337 337 338 338 while ((dp = readdir(dirp))) { // 1. … … 345 345 } 346 346 check_ok_break(rc, "Name too long (limit is %"PRIdn" excluding null-terminator)", name_buffer_size); 347 // add slash to the beginning of the name, because vfs_walk requires the path to be absolute (will be 348 // resolved relatively to the starting directory) 349 char name_with_slash[name_buffer_size+1]; 350 name_with_slash[0] = '/'; 351 str_cpy(name_with_slash + 1, name_size + 1, dp->d_name); 347 352 // 2. 348 353 int entry_handle1; // don't forget to put 349 rc = vfs_walk(item.handle1, dp->d_name, 0, &entry_handle1);350 check_ok_break(rc, "(0) Failed to find entry \"%s\" in directory of handle %d\n", dp->d_name, item.handle1);354 rc = vfs_walk(item.handle1, name_with_slash, 0, &entry_handle1); 355 check_ok_break(rc, "(0) Failed to find entry \"%s\" in directory of handle %d\n", name_with_slash, item.handle1); 351 356 // 3. 352 357 int entry_handle2; // must be put 353 rc= vfs_walk(item.handle2, dp->d_name, 0, &entry_handle2);358 rc= vfs_walk(item.handle2, name_with_slash, 0, &entry_handle2); 354 359 if (rc != EOK) { 355 360 errno_t rc2 = vfs_put(entry_handle1); … … 360 365 break; 361 366 } 362 check_ok_break(rc, "(1) Failed to find entry \"%s\" in directory of handle %d\n", dp->d_name, item.handle2);367 check_ok_break(rc, "(1) Failed to find entry \"%s\" in directory of handle %d\n", name_with_slash, item.handle2); 363 368 } 364 369
Note:
See TracChangeset
for help on using the changeset viewer.
