1From e98f76074b3d35856e43da9c9b3ac51295391543 Mon Sep 17 00:00:00 2001 2From: Jerome Duval <jerome.duval@gmail.com> 3Date: Mon, 24 Oct 2022 09:44:42 +0200 4Subject: disable st_rdev for Haiku 5 6 7diff --git a/compat/compat.h b/compat/compat.h 8index 70ac2f4..5cd7bb7 100644 9--- a/compat/compat.h 10+++ b/compat/compat.h 11@@ -186,11 +186,15 @@ int inet_aton(const char *, struct in_addr *); 12 ** machine. 13 */ 14 15+#ifdef __HAIKU__ 16+#define compat_makedev(maj, min) 0 17+#else 18 # ifdef MAKEDEV_THREE_ARGS 19 # define compat_makedev(maj, min) makedev(0, maj, min) 20 # else 21 # define compat_makedev makedev 22 # endif 23+#endif 24 25 #endif /* NEED_MAKEDEV */ 26 27diff --git a/lib/append.c b/lib/append.c 28index 00c9aef..76122a4 100644 29--- a/lib/append.c 30+++ b/lib/append.c 31@@ -102,9 +102,11 @@ tar_append_file(TAR *t, const char *realname, const char *savename) 32 td = (tar_dev_t *)libtar_hashptr_data(&hp); 33 else 34 { 35+#ifndef __HAIKU__ 36 #ifdef DEBUG 37 printf("+++ adding hash for device (0x%lx, 0x%lx)...\n", 38 major(s.st_dev), minor(s.st_dev)); 39+#endif 40 #endif 41 td = (tar_dev_t *)calloc(1, sizeof(tar_dev_t)); 42 if (td == NULL) 43diff --git a/lib/encode.c b/lib/encode.c 44index 5ea29ff..c6ef39e 100644 45--- a/lib/encode.c 46+++ b/lib/encode.c 47@@ -144,12 +144,14 @@ th_set_link(TAR *t, const char *linkname) 48 void 49 th_set_device(TAR *t, dev_t device) 50 { 51+#ifndef __HAIKU__ 52 #ifdef DEBUG 53 printf("th_set_device(): major = %d, minor = %d\n", 54 major(device), minor(device)); 55 #endif 56 int_to_oct(major(device), t->th_buf.devmajor, 8); 57 int_to_oct(minor(device), t->th_buf.devminor, 8); 58+#endif 59 } 60 61 62-- 632.30.2 64 65