summaryrefslogtreecommitdiffhomepage
path: root/src/logic/tpax_archive_enqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic/tpax_archive_enqueue.c')
-rw-r--r--src/logic/tpax_archive_enqueue.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/logic/tpax_archive_enqueue.c b/src/logic/tpax_archive_enqueue.c
index 8685cad..7d8c278 100644
--- a/src/logic/tpax_archive_enqueue.c
+++ b/src/logic/tpax_archive_enqueue.c
@@ -192,7 +192,9 @@ static int tpax_archive_add_queue_item(
const struct dirent * dirent,
const struct tpax_dirent * parent,
const char * prefix,
+ dev_t srdev,
dev_t stdev,
+ ino_t stino,
int depth,
int flags,
int fdat,
@@ -233,10 +235,21 @@ static int tpax_archive_add_queue_item(
cdent->depth = depth;
cdent->flags = flags;
cdent->stdev = stdev;
+ cdent->stino = stino;
cdent->nsize = needed;
cdent->parent = parent;
cdent->prefix = prefix;
+ switch (dirent->d_type) {
+ case DT_CHR:
+ case DT_BLK:
+ cdent->srdev = srdev;
+ break;
+
+ default:
+ cdent->srdev = 0777777;
+ }
+
memset(&cdent->dirent,0,offsetof(struct dirent,d_name));
cdent->dirent.d_ino = dirent->d_ino;
@@ -365,7 +378,9 @@ static int tpax_archive_enqueue_dir_entries(
if (tpax_archive_add_queue_item(
dctx,dirent,dent,0,
- st.st_dev,depth,
+ st.st_rdev,
+ st.st_dev,st.st_ino,
+ depth,
TPAX_ITEM_IMPLICIT,
fd,&fkeep) < 0)
return tpax_archive_enqueue_ret(
@@ -404,7 +419,9 @@ static int tpax_archive_enqueue_dir_entries(
if (tpax_archive_add_queue_item(
dctx,lnkent,cdent,0,
- lnkst.st_dev,depth+1,
+ lnkst.st_rdev,
+ lnkst.st_dev,lnkst.st_ino,
+ depth+1,
TPAX_ITEM_IMPLICIT|TPAX_ITEM_SYMLINK,
fd,&fkeep) < 0)
return tpax_archive_enqueue_ret(
@@ -515,7 +532,9 @@ int tpax_archive_enqueue(
/* add to queue */
if (tpax_archive_add_queue_item(
dctx,dirent,0,prefix,
- uctx->st->st_dev,0,
+ uctx->st->st_rdev,
+ uctx->st->st_dev,
+ uctx->st->st_ino,0,
TPAX_ITEM_EXPLICIT,
fdat,&fkeep) < 0)
return tpax_archive_enqueue_ret(
@@ -548,7 +567,9 @@ int tpax_archive_enqueue(
if (tpax_archive_add_queue_item(
dctx,lnkent,cdent,0,
- lnkst.st_dev,1,
+ lnkst.st_rdev,
+ lnkst.st_dev,lnkst.st_ino,
+ 1,
TPAX_ITEM_EXPLICIT|TPAX_ITEM_SYMLINK,
fdat,&fkeep) < 0)
return tpax_archive_enqueue_ret(