Files
haikuports/dev-libs/libtar/patches/libtar-1.2.20.patchset
2022-10-24 10:05:07 +02:00

65 lines
1.6 KiB
Plaintext

From e98f76074b3d35856e43da9c9b3ac51295391543 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 24 Oct 2022 09:44:42 +0200
Subject: disable st_rdev for Haiku
diff --git a/compat/compat.h b/compat/compat.h
index 70ac2f4..5cd7bb7 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -186,11 +186,15 @@ int inet_aton(const char *, struct in_addr *);
** machine.
*/
+#ifdef __HAIKU__
+#define compat_makedev(maj, min) 0
+#else
# ifdef MAKEDEV_THREE_ARGS
# define compat_makedev(maj, min) makedev(0, maj, min)
# else
# define compat_makedev makedev
# endif
+#endif
#endif /* NEED_MAKEDEV */
diff --git a/lib/append.c b/lib/append.c
index 00c9aef..76122a4 100644
--- a/lib/append.c
+++ b/lib/append.c
@@ -102,9 +102,11 @@ tar_append_file(TAR *t, const char *realname, const char *savename)
td = (tar_dev_t *)libtar_hashptr_data(&hp);
else
{
+#ifndef __HAIKU__
#ifdef DEBUG
printf("+++ adding hash for device (0x%lx, 0x%lx)...\n",
major(s.st_dev), minor(s.st_dev));
+#endif
#endif
td = (tar_dev_t *)calloc(1, sizeof(tar_dev_t));
if (td == NULL)
diff --git a/lib/encode.c b/lib/encode.c
index 5ea29ff..c6ef39e 100644
--- a/lib/encode.c
+++ b/lib/encode.c
@@ -144,12 +144,14 @@ th_set_link(TAR *t, const char *linkname)
void
th_set_device(TAR *t, dev_t device)
{
+#ifndef __HAIKU__
#ifdef DEBUG
printf("th_set_device(): major = %d, minor = %d\n",
major(device), minor(device));
#endif
int_to_oct(major(device), t->th_buf.devmajor, 8);
int_to_oct(minor(device), t->th_buf.devminor, 8);
+#endif
}
--
2.30.2