1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
diff -ru libsmbios-2.4.2.orig/src/libsmbios_c/cmos/cmos_linux.c libsmbios-2.4.2/src/libsmbios_c/cmos/cmos_linux.c
--- libsmbios-2.4.2.orig/src/libsmbios_c/cmos/cmos_linux.c 2018-06-06 17:40:24.000000000 +0300
+++ libsmbios-2.4.2/src/libsmbios_c/cmos/cmos_linux.c 2019-06-07 16:37:59.007546237 +0300
@@ -35,6 +35,13 @@
// private
#include "cmos_impl.h"
+#ifndef outb_p
+#define outb_p outb
+#endif
+#ifndef inb_p
+#define inb_p inb
+#endif
+
static int linux_read_fn(const struct cmos_access_obj *this, u8 *byte, u32 indexPort, u32 dataPort, u32 offset)
{
outb_p (offset, indexPort);
diff -ru libsmbios-2.4.2.orig/src/libsmbios_c/common/common.c libsmbios-2.4.2/src/libsmbios_c/common/common.c
--- libsmbios-2.4.2.orig/src/libsmbios_c/common/common.c 2018-06-06 17:40:24.000000000 +0300
+++ libsmbios-2.4.2/src/libsmbios_c/common/common.c 2019-06-07 16:34:05.293776855 +0300
@@ -26,10 +26,15 @@
if ((size_t)(bufsize - curstrsize - 1) < bufsize)
{
+#ifdef __GLIBC__
char *buf = strerror_r(errval, errbuf + curstrsize, bufsize - curstrsize - 1);
// GNU breakage... :(
if (buf != (errbuf + curstrsize))
strlcat(errbuf, buf, bufsize);
+#else
+ /* XSI compliant strerror_r() */
+ strerror_r(errval, errbuf + curstrsize, bufsize - curstrsize - 1);
+#endif
}
}
#endif
diff -ru libsmbios-2.4.2.orig/src/libsmbios_c/smi/smi_linux.c libsmbios-2.4.2/src/libsmbios_c/smi/smi_linux.c
--- libsmbios-2.4.2.orig/src/libsmbios_c/smi/smi_linux.c 2018-06-06 17:40:24.000000000 +0300
+++ libsmbios-2.4.2/src/libsmbios_c/smi/smi_linux.c 2019-06-07 16:34:05.293776855 +0300
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <fcntl.h>
#include <sys/file.h> // flock
#include <sys/ioctl.h> // ioctl
#include <errno.h>
|