cdrkit-1.1.11-rootstat.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. diff -up cdrkit-1.1.11/genisoimage/tree.c.rootstat cdrkit-1.1.11/genisoimage/tree.c
  2. --- cdrkit-1.1.11/genisoimage/tree.c.rootstat 2011-01-25 14:15:36.766389403 +0100
  3. +++ cdrkit-1.1.11/genisoimage/tree.c 2011-01-25 14:17:24.804643126 +0100
  4. @@ -48,6 +48,7 @@
  5. #include <fctldefs.h>
  6. #include <device.h>
  7. #include <schily.h>
  8. +#include <libgen.h>
  9. extern int allow_limited_size;
  10. @@ -1421,12 +1422,16 @@ insert_file_entry(struct directory *this
  11. return (0);
  12. }
  13. if (this_dir == root && strcmp(short_name, ".") == 0)
  14. - root_statbuf = statbuf; /* Save this for later on */
  15. + memcpy(&root_statbuf, &statbuf, sizeof(root_statbuf)); /* Save this for later on */
  16. /* We do this to make sure that the root entries are consistent */
  17. if (this_dir == root && strcmp(short_name, "..") == 0) {
  18. - statbuf = root_statbuf;
  19. - lstatbuf = root_statbuf;
  20. + /* for the case .. comes before . */
  21. + if (!root_statbuf.st_ctime) {
  22. + stat_filter(dirname(whole_path), &root_statbuf);
  23. + }
  24. + memcpy(&statbuf, &root_statbuf, sizeof(statbuf));
  25. + memcpy(&lstatbuf, &root_statbuf, sizeof(lstatbuf));
  26. }
  27. if (S_ISLNK(lstatbuf.st_mode)) {