Added a few comments about ino_t compatibility

This commit is contained in:
Thomas Schmitt 2014-05-18 14:45:31 +00:00
parent 1e35e9dd88
commit 8016bce6ae
2 changed files with 16 additions and 6 deletions

View File

@ -167,9 +167,19 @@ int Xorriso__get_di(IsoNode *node, dev_t *dev, ino_t *ino, int flag)
goto ex; goto ex;
} }
vpt= (unsigned char *) value; vpt= (unsigned char *) value;
if(vpt[0] > sizeof(ino_t)) {
/* >>> obviously not the same system that recorded the device number */;
}
for(i= 1; i <= vpt[0] && i < (int) value_length; i++) for(i= 1; i <= vpt[0] && i < (int) value_length; i++)
*dev= ((*dev) << 8) | vpt[i]; *dev= ((*dev) << 8) | vpt[i];
i_end= i + vpt[i] + 1; i_end= i + vpt[i] + 1;
if(vpt[i] > sizeof(ino_t)) {
/* >>> obviously not the same system that recorded the inode number */;
}
for(i++; i < i_end && i < (int) value_length; i++) for(i++; i < i_end && i < (int) value_length; i++)
*ino= ((*ino) << 8) | vpt[i]; *ino= ((*ino) << 8) | vpt[i];
free(value); free(value);
@ -646,9 +656,9 @@ int Xorriso_hardlink_update(struct XorrisO *xorriso, int *compare_result,
"xorriso_DEBUG: old_idx= %d , low= %d , high= %d , iso= '%s' , disk='%s'\n", "xorriso_DEBUG: old_idx= %d , low= %d , high= %d , iso= '%s' , disk='%s'\n",
old_idx, low, high, iso_rr_path, disk_path); old_idx, low, high, iso_rr_path, disk_path);
fprintf(stderr, fprintf(stderr,
"xorriso_DEBUG: old_dev= %lu , old_ino= %lu , dev= %lu , ino= %lu\n", "xorriso_DEBUG: old_dev= %lu , old_ino= %.f , dev= %lu , ino= %.f\n",
(unsigned long) old_dev, (unsigned long) old_ino, (unsigned long) old_dev, (double) old_ino,
(unsigned long) stbuf.st_dev, (unsigned long) stbuf.st_ino); (unsigned long) stbuf.st_dev, (double) stbuf.st_ino);
if(idx >= 0 && idx != old_idx) if(idx >= 0 && idx != old_idx)
fprintf(stderr, "xorriso_DEBUG: idx= %d , old_idx = %d\n", idx, old_idx); fprintf(stderr, "xorriso_DEBUG: idx= %d , old_idx = %d\n", idx, old_idx);
@ -667,8 +677,8 @@ int Xorriso_hardlink_update(struct XorrisO *xorriso, int *compare_result,
dev_t dev; dev_t dev;
Xorriso__get_di(xorriso->di_array[i], &dev, &ino, 0); Xorriso__get_di(xorriso->di_array[i], &dev, &ino, 0);
fprintf(stderr, "xorriso_DEBUG: iso_sibling= '%s' , dev= %lu , ino= %lu\n", fprintf(stderr, "xorriso_DEBUG: iso_sibling= '%s' , dev= %lu , ino= %.f\n",
node_path, (unsigned long) dev, (unsigned long) ino); node_path, (unsigned long) dev, (double) ino);
} }
#endif /* Xorriso_hardlink_update_debuG */ #endif /* Xorriso_hardlink_update_debuG */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2014.05.03.115011" #define Xorriso_timestamP "2014.05.18.144453"