mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
866 B

  1. diff -dur mine-0.24/md5sum.c mine-0.24-p/md5sum.c
  2. --- mine-0.24/md5sum.c 2005-08-09 12:57:29.000000000 +0200
  3. +++ mine-0.24-p/md5sum.c 2006-03-24 22:00:15.000000000 +0100
  4. @@ -20,6 +20,7 @@
  5. #include <stdio.h>
  6. #include <dirent.h>
  7. #include <string.h>
  8. +#include <sys/types.h>
  9. #include <sys/stat.h>
  10. #include <unistd.h>
  11. @@ -37,8 +38,14 @@
  12. struct stat statbuf;
  13. snprintf(realfilename, 1024, "%s/%s", root, filename);
  14. - return (stat(realfilename, &statbuf) != 0 || S_ISFIFO(statbuf.st_mode))
  15. - ? "" : md5_file(realfilename);
  16. + if (stat(realfilename, &statbuf) != 0)
  17. + return "";
  18. + else if ( S_ISCHR(statbuf.st_mode) || S_ISBLK(statbuf.st_mode)
  19. + || S_ISLNK(statbuf.st_mode) || S_ISSOCK(statbuf.st_mode)
  20. + || S_ISFIFO(statbuf.st_mode) )
  21. + return "X";
  22. + else
  23. + return md5_file(realfilename);
  24. }
  25. /* Returns 1 if file is duplicate, 2 if file is modified. */