summaryrefslogtreecommitdiff
path: root/sysutils/smartmontools/patches
diff options
context:
space:
mode:
authormartin <martin@pkgsrc.org>2006-04-20 23:22:04 +0000
committermartin <martin@pkgsrc.org>2006-04-20 23:22:04 +0000
commit0fd3cf2dc02c0cb15d3413c9486c07151f2eaa2e (patch)
treee26aac7e643f7d2a3038759b1194e3c0694ff06f /sysutils/smartmontools/patches
parentdf802b79b78c1ce80c2ea0889312c5ddd826887a (diff)
downloadpkgsrc-0fd3cf2dc02c0cb15d3413c9486c07151f2eaa2e.tar.gz
Fix string output of IDENTIFY on little endian machines (which I broke
with the previous version). Noted by Rhialto in private mail.
Diffstat (limited to 'sysutils/smartmontools/patches')
-rw-r--r--sysutils/smartmontools/patches/patch-ad11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysutils/smartmontools/patches/patch-ad b/sysutils/smartmontools/patches/patch-ad
index 938cf04f2ef..5ac6baea287 100644
--- a/sysutils/smartmontools/patches/patch-ad
+++ b/sysutils/smartmontools/patches/patch-ad
@@ -1,15 +1,18 @@
-$NetBSD: patch-ad,v 1.1 2005/09/07 07:32:10 martin Exp $
+$NetBSD: patch-ad,v 1.2 2006/04/20 23:22:04 martin Exp $
--- ataprint.c.orig 2004-06-04 22:59:16.000000000 +0200
-+++ ataprint.c 2005-08-15 22:18:08.000000000 +0200
-@@ -90,7 +90,11 @@ void formatdriveidstring(char *out, cons
++++ ataprint.c 2006-04-21 01:10:45.000000000 +0200
+@@ -90,7 +90,14 @@
char tmp[65];
n = n > 64 ? 64 : n;
+#ifndef __NetBSD__
swapbytes(tmp, in, n);
+#else
-+ strncpy(tmp, in, n); /* NetBSD delivers host byte order strings */
++ if (isbigendian())
++ strncpy(tmp, in, n);
++ else
++ swapbytes(tmp, in, n);
+#endif
tmp[n] = '\0';
trim(out, tmp);