902-file-kfreebsd.dpatch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh /usr/share/dpatch/dpatch-run
  2. ## 902-file-kfreebsd.dpatch by Robert Millan <rmh@aybabtu.com>
  3. ##
  4. ## DP: Detect GNU/kFreeBSD binaries (closes: #307475).
  5. @DPATCH@
  6. diff -Naurp file-4.23.orig/src/readelf.c file-4.23/src/readelf.c
  7. --- file-4.23.orig/src/readelf.c 2008-01-12 17:50:20.000000000 +0000
  8. +++ file-4.23/src/readelf.c 2008-01-12 17:50:01.000000000 +0000
  9. @@ -397,6 +397,14 @@ donote(struct magic_set *ms, unsigned ch
  10. if (file_printf(ms, "Solaris") == -1)
  11. return size;
  12. break;
  13. + case GNU_OS_KFREEBSD:
  14. + if (file_printf(ms, "kFreeBSD") == -1)
  15. + return size;
  16. + break;
  17. + case GNU_OS_KNETBSD:
  18. + if (file_printf(ms, "kNetBSD") == -1)
  19. + return size;
  20. + break;
  21. default:
  22. if (file_printf(ms, "<unknown>") == -1)
  23. return size;
  24. diff -Naurp file-4.23.orig/src/readelf.h file-4.23/src/readelf.h
  25. --- file-4.23.orig/src/readelf.h 2007-12-27 16:08:22.000000000 +0000
  26. +++ file-4.23/src/readelf.h 2008-01-12 17:50:01.000000000 +0000
  27. @@ -229,5 +229,7 @@ typedef struct {
  28. #define GNU_OS_LINUX 0
  29. #define GNU_OS_HURD 1
  30. #define GNU_OS_SOLARIS 2
  31. +#define GNU_OS_KFREEBSD 3
  32. +#define GNU_OS_KNETBSD 4
  33. #endif