Mark the dummy top-level directory (created when multiple sources are on the
command line or -keep-as-directory is set) as a PSEUDO file to indicate it
doesn't really exist.
This fixes the llistxattr failure occasionally seen.
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
index 4820cc4..daaeb1f 100644
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
@@ -3533,7 +3533,7 @@
if(pathname[0] == '\0') {
/*
- *dummy top level directory, if multiple sources specified on
+ * dummy top level directory, if multiple sources specified on
* command line
*/
memset(&buf, 0, sizeof(buf));
@@ -3543,13 +3543,17 @@
buf.st_mtime = time(NULL);
buf.st_dev = 0;
buf.st_ino = 0;
- } else if(lstat(pathname, &buf) == -1) {
- ERROR("Cannot stat dir/file %s because %s, ignoring", pathname,
- strerror(errno));
- return;
+ dir_ent->inode = lookup_inode(&buf);
+ dir_ent->inode->pseudo_file = PSEUDO_FILE_OTHER;
+ } else {
+ if(lstat(pathname, &buf) == -1) {
+ ERROR("Cannot stat dir/file %s because %s, ignoring",
+ pathname, strerror(errno));
+ return;
+ }
+ dir_ent->inode = lookup_inode(&buf);
}
- dir_ent->inode = lookup_inode(&buf);
if(root_inode_number) {
dir_ent->inode->inode_number = root_inode_number;
dir_inode_no --;