- SLOG("statpath: %s", cfrombstr(statpath));
- EC_ZERO_LOG(stat(cfrombstr(statpath), &st));
- SLOG("db query: did: %u, name: %s, dev: %08x, ino: %08x",
- ntohl(did), cfrombstr(l->entry[i]), st.st_dev, st.st_ino);
- cnid = cnid_add(vol->v_cdb,
- &st,
- did,
- cfrombstr(l->entry[i]),
- blength(l->entry[i]),
- 0);
-
+ EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st),
+ "lstat(rpath: %s, elem: %s): %s: %s",
+ cfrombstr(rpath), cfrombstr(l->entry[i]),
+ cfrombstr(statpath), strerror(errno));
+
+ if ((cnid = cnid_add(vol->vol->v_cdb,
+ &st,
+ *did,
+ cfrombstr(l->entry[i]),
+ blength(l->entry[i]),
+ 0)) == CNID_INVALID) {
+ EC_FAIL;
+ }