summaryrefslogtreecommitdiff
path: root/sysutils/xmbmon/files/patch-getMB-smb_ioctl.c
diff options
context:
space:
mode:
authorMichael Gmelin <grembo@FreeBSD.org>2015-05-01 22:40:00 +0000
committerMichael Gmelin <grembo@FreeBSD.org>2015-05-01 22:40:00 +0000
commit1adbf67ae224c29491d599245e096f190399f033 (patch)
treef0410ae278cce8e7f0477e9d96132fc18c89f268 /sysutils/xmbmon/files/patch-getMB-smb_ioctl.c
parentaudio/festival: unbreak fetching Debian patches (diff)
Fix build on HEAD after SMBus change (r281985/r282256).
Approved by: mentors (implicit)
Notes
Notes: svn path=/head/; revision=385155
Diffstat (limited to 'sysutils/xmbmon/files/patch-getMB-smb_ioctl.c')
-rw-r--r--sysutils/xmbmon/files/patch-getMB-smb_ioctl.c66
1 files changed, 65 insertions, 1 deletions
diff --git a/sysutils/xmbmon/files/patch-getMB-smb_ioctl.c b/sysutils/xmbmon/files/patch-getMB-smb_ioctl.c
index 7fe81da58542..224e503a70c3 100644
--- a/sysutils/xmbmon/files/patch-getMB-smb_ioctl.c
+++ b/sysutils/xmbmon/files/patch-getMB-smb_ioctl.c
@@ -1,7 +1,7 @@
$FreeBSD$
--- getMB-smb_ioctl.c.orig Sat Jul 5 18:15:24 2003
-+++ getMB-smb_ioctl.c Fri Dec 16 17:56:54 2005
++++ getMB-smb_ioctl.c Sat May 2 00:35:54 2015
@@ -5,6 +5,7 @@
#ifdef HAVE_SMBUS
/* assume SMBus ioctl support, only for FreeBSD */
@@ -22,3 +22,67 @@ $FreeBSD$
#include "methods.h"
+@@ -42,10 +47,12 @@
+
+ static int OpenIO()
+ {
+- char byte;
+ struct smbcmd cmd;
+ cmd.slave = smb_slave;
++#if (__FreeBSD_version < 1100071)
++ char byte;
+ cmd.data.byte_ptr = &byte;
++#endif
+
+ if ((iosmb = open(smb_devfile, 000)) < 0) {
+ strcpy(buf, "ioctl(");
+@@ -125,7 +132,12 @@
+ char ret;
+ cmd.slave = slave;
+ cmd.cmd = addr;
++#if (__FreeBSD_version >= 1100071)
++ cmd.rbuf = &ret;
++ cmd.rcount = 1;
++#else
+ cmd.data.byte_ptr = &ret;
++#endif
+ if (ioctl(iosmb, SMB_READB, &cmd) == -1) {
+ /* strcpy(buf, "ioctl(");
+ strcat(buf, smb_devfile + 5);
+@@ -142,7 +154,11 @@
+ struct smbcmd cmd;
+ cmd.slave = slave;
+ cmd.cmd = addr;
++#if (__FreeBSD_version >= 1100071)
++ cmd.wdata.byte = value;
++#else
+ cmd.data.byte = value;
++#endif
+ if (ioctl(iosmb, SMB_WRITEB, &cmd) == -1) {
+ strcpy(buf, "ioctl(");
+ strcat(buf, smb_devfile + 5);
+@@ -158,7 +174,12 @@
+ short ret;
+ cmd.slave = smb_slave;
+ cmd.cmd = addr;
++#if (__FreeBSD_version >= 1100071)
++ cmd.rbuf = (char*) &ret;
++ cmd.rcount = 2;
++#else
+ cmd.data.word_ptr = &ret;
++#endif
+ if (ioctl(iosmb, SMB_READW, &cmd) == -1) {
+ /* strcpy(buf, "ioctl(");
+ strcat(buf, smb_devfile + 5);
+@@ -175,7 +196,11 @@
+ struct smbcmd cmd;
+ cmd.slave = slave;
+ cmd.cmd = addr;
++#if (__FreeBSD_version >= 1100071)
++ cmd.wdata.word = value;
++#else
+ cmd.data.word = value;
++#endif
+ if (ioctl(iosmb, SMB_WRITEW, &cmd) == -1) {
+ strcpy(buf, "ioctl(");
+ strcat(buf, smb_devfile + 5);