summaryrefslogtreecommitdiff
path: root/sysutils/healthd/files/patch-getMB-smb.c
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2016-03-23 06:51:50 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2016-03-23 06:51:50 +0000
commit99076f7c8aa0c1517d2358f871e98f013e86c477 (patch)
treea04dc85aae357b971aa63620fb39855705447ed9 /sysutils/healthd/files/patch-getMB-smb.c
parentUpdate dependencies. (diff)
- Add LICENSE_FILE
- Switch to options helpers - Silence patching - Regenerate patches with `make makepatch`
Notes
Notes: svn path=/head/; revision=411685
Diffstat (limited to 'sysutils/healthd/files/patch-getMB-smb.c')
-rw-r--r--sysutils/healthd/files/patch-getMB-smb.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sysutils/healthd/files/patch-getMB-smb.c b/sysutils/healthd/files/patch-getMB-smb.c
new file mode 100644
index 000000000000..0af9f478fa2a
--- /dev/null
+++ b/sysutils/healthd/files/patch-getMB-smb.c
@@ -0,0 +1,45 @@
+--- getMB-smb.c.orig 2004-08-17 01:32:39 UTC
++++ getMB-smb.c
+@@ -31,6 +31,7 @@
+ #endif
+
+ #ifdef HAVE_SMBUS
++#include <osreldate.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+@@ -90,7 +91,9 @@ OpenIO(void) {
+ }
+
+ cmd.cmd = 0x47;
++#if (__FreeBSD_version < 1100071)
+ cmd.data.byte_ptr = &byte;
++#endif
+ for (i = 0; i < sizeof(addrs); i++) {
+ cmd.slave = addrs[i];
+ if (ioctl(iosmb, SMB_READB, (caddr_t)&cmd) != -1) {
+@@ -115,7 +118,11 @@ WriteByte(int addr,int value) {
+ count = 0;
+ cmd.slave = smb_addr;
+ cmd.cmd = addr;
++#if (__FreeBSD_version >= 1100071)
++ cmd.wdata.byte = value;
++#else
+ cmd.data.byte = value;
++#endif
+ while (ioctl(iosmb, SMB_WRITEB, &cmd) == -1) {
+ if (++count < 3) {
+ sleep(1);
+@@ -136,7 +143,12 @@ ReadByte(int addr) {
+
+ cmd.slave = smb_addr;
+ cmd.cmd = addr;
++#if (__FreeBSD_version >= 1100071)
++ cmd.rbuf = &ret;
++ cmd.rcount = 1;
++#else
+ cmd.data.byte_ptr = &ret;
++#endif
+ while (ioctl(iosmb, SMB_READB, &cmd) == -1) {
+ if (++count < 3) {
+ sleep(1);