403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.116
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/sysutils/xmbmon/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/sysutils/xmbmon/files/patch-getMB-smb_ioctl.c
--- getMB-smb_ioctl.c.orig	2003-07-05 15:15:24 UTC
+++ getMB-smb_ioctl.c
@@ -5,6 +5,7 @@
 #ifdef HAVE_SMBUS
 /* assume SMBus ioctl support, only for FreeBSD */
 
+#include <sys/param.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
@@ -13,7 +14,11 @@
 #include <sys/types.h>
 #include <sys/ioctl.h>
 
+#if __FreeBSD_version >= 500000
+#include <dev/smbus/smb.h>
+#else
 #include <machine/smb.h>
+#endif
 
 #include "methods.h"
 
@@ -42,10 +47,12 @@ static char buf[128];
 
 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 @@ int smbioctl_readB(int slave, int addr)
 	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 @@ void smbioctl_writeB(int slave, int addr
 	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 @@ int smbioctl_readW(int smb_slave, int ad
 	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 @@ void smbioctl_writeW(int slave, int addr
 	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);

Youez - 2016 - github.com/yon3zu
LinuXploit