/* * This function prints a pathname, using the ext2fs_get_pathname * function */ static void print_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino) { errcode_t retval; char *path; if (!dir && (ino < num_special_inodes)) { fputs(_(special_inode_name[ino]), stdout); return; } retval = ext2fs_get_pathname(fs, dir, ino, &path); if (retval) fputs("???", stdout); else { safe_print(path, -1); ext2fs_free_mem(&path); } }
/* * This function prints a pathname, using the ext2fs_get_pathname * function */ static void print_pathname(FILE *f, ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino) { errcode_t retval = 0; char *path; if (!dir && (ino < num_special_inodes)) { fputs(_(special_inode_name[ino]), f); return; } if (fs) retval = ext2fs_get_pathname(fs, dir, ino, &path); if (!fs || retval) fputs("???", f); else { safe_print(f, path, -1); ext2fs_free_mem(&path); } }