char *buf, char **name)
{
struct get_pathname_struct gp;
- char *parent_name, *ret;
+ char *parent_name = 0, *ret;
errcode_t retval;
if (dir == ino) {
gp.errcode = 0;
retval = ext2fs_dir_iterate(fs, dir, 0, buf, get_pathname_proc, &gp);
- if (retval)
+ if (retval == EXT2_ET_NO_DIRECTORY) {
+ char buf[32];
+
+ if (ino)
+ snprintf(buf, sizeof(buf), "<%u>/<%u>", dir, ino);
+ else
+ snprintf(buf, sizeof(buf), "<%u>", dir);
+ retval = ext2fs_get_mem(strlen(buf)+1, name);
+ if (retval)
+ goto cleanup;
+ strcpy(*name, buf);
+ return 0;
+ } else if (retval)
goto cleanup;
if (gp.errcode) {
retval = gp.errcode;
else
strcat(ret, "???");
*name = ret;
- ext2fs_free_mem(&parent_name);
retval = 0;
cleanup:
- if (gp.name)
- ext2fs_free_mem(&gp.name);
+ ext2fs_free_mem(&parent_name);
+ ext2fs_free_mem(&gp.name);
return retval;
}
Root inode is not a directory. Clear? yes
Pass 2: Checking directory structure
-Entry '..' in ??? (11) has deleted/unused inode 2. Clear? yes
+Entry '..' in <2>/<11> (11) has deleted/unused inode 2. Clear? yes
Pass 3: Checking directory connectivity
Root inode not allocated. Allocate? yes
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
-Entry '.' in ??? (12) is duplicate '.' entry.
+Entry '.' in <14>/<12> (12) is duplicate '.' entry.
Fix? yes
-Entry '..' in ??? (12) is duplicate '..' entry.
+Entry '..' in <14>/<12> (12) is duplicate '..' entry.
Fix? yes
Pass 3: Checking directory connectivity
Entry 'dir' in / (2) has an incorrect filetype (was 2, should be 6).
Fix? yes
-Entry '..' in ??? (13) has an incorrect filetype (was 2, should be 6).
+Entry '..' in <12>/<13> (13) has an incorrect filetype (was 2, should be 6).
Fix? yes
-Entry '..' in ??? (14) has an incorrect filetype (was 2, should be 6).
+Entry '..' in <12>/<14> (14) has an incorrect filetype (was 2, should be 6).
Fix? yes
-Entry '..' in ??? (15) has an incorrect filetype (was 2, should be 6).
+Entry '..' in <12>/<15> (15) has an incorrect filetype (was 2, should be 6).
Fix? yes
Pass 3: Checking directory connectivity
-Unconnected directory inode 13 (???)
+Unconnected directory inode 13 (<12>/<13>)
Connect to /lost+found? yes
-Unconnected directory inode 14 (???)
+Unconnected directory inode 14 (<12>/<14>)
Connect to /lost+found? yes
-Unconnected directory inode 15 (???)
+Unconnected directory inode 15 (<12>/<15>)
Connect to /lost+found? yes
Pass 4: Checking reference counts