ssiapi: Upgrade to 1.3.0

Fix out of tree builds
Fix build with clang as well as musl
Refresh and forward port patches as needed
Update boost headers

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2019-08-29 13:07:35 -07:00
parent 31a55b947d
commit 7127971a48
20 changed files with 2080 additions and 1257 deletions

View File

@ -0,0 +1,116 @@
From dd6ad8ca447457c812809791ab8622da8646104c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 30 Aug 2019 13:07:33 -0700
Subject: [PATCH] Don't use __GNUC_PREREQ
These are not official GCC predefined macros; they are macros defined
by GNU libc and some versions of BSD libc for internal use by their
own headers, and we shouldn't be using them without checking for their
availability first
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/efi/efi.h | 4 ++--
lib/engine/pragma.h | 4 ++--
lib/log/log.h | 4 ++--
lib/mpb/machine_bytes.h | 4 ++--
lib/mpb/mpb.h | 4 ++--
lib/orom/orom.h | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/efi/efi.h b/lib/efi/efi.h
index 0620d9c..c8358db 100644
--- a/lib/efi/efi.h
+++ b/lib/efi/efi.h
@@ -33,9 +33,9 @@
#include <features.h>
#include <ssi.h>
-#if __GNUC_PREREQ(3, 4)
+#if ((defined __GNUC__ && __GNUC__ >= 3 && __GNUC_MINOR__ >= 4) || defined __clang__)
#pragma once
-#endif /* __GNUC_PREREQ */
+#endif
#if defined(__cplusplus)
extern "C" {
diff --git a/lib/engine/pragma.h b/lib/engine/pragma.h
index 8205ed3..fa0b268 100644
--- a/lib/engine/pragma.h
+++ b/lib/engine/pragma.h
@@ -32,9 +32,9 @@
#include <features.h>
-#if __GNUC_PREREQ(3, 4)
+#if ((defined __GNUC__ && __GNUC__ >= 3 && __GNUC_MINOR__ >= 4) || defined __clang__)
#define SSI_HAS_PRAGMA_ONCE
-#endif /* __GNUC_PREREQ */
+#endif
#ifdef SSI_HAS_PRAGMA_ONCE
#pragma once
diff --git a/lib/log/log.h b/lib/log/log.h
index 66a707b..ca5000a 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -32,9 +32,9 @@
#include <features.h>
-#if __GNUC_PREREQ(3, 4)
+#if ((defined __GNUC__ && __GNUC__ >= 3 && __GNUC_MINOR__ >= 4) || defined __clang__)
#pragma once
-#endif /* __GNUC_PREREQ */
+#endif
#if defined(__cplusplus)
extern "C" {
diff --git a/lib/mpb/machine_bytes.h b/lib/mpb/machine_bytes.h
index 6cb81c9..807461f 100644
--- a/lib/mpb/machine_bytes.h
+++ b/lib/mpb/machine_bytes.h
@@ -27,9 +27,9 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if __GNUC_PREREQ(3, 4)
+#if ((defined __GNUC__ && __GNUC__ >= 3 && __GNUC_MINOR__ >= 4) || defined __clang__)
#pragma once
-#endif /* __GNUC_PREREQ */
+#endif
#ifndef __ENDIAN_H__INCLUDED__
#define __ENDIAN_H__INCLUDED__
diff --git a/lib/mpb/mpb.h b/lib/mpb/mpb.h
index 32beb21..98f82fe 100644
--- a/lib/mpb/mpb.h
+++ b/lib/mpb/mpb.h
@@ -27,9 +27,9 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if __GNUC_PREREQ(3, 4)
+#if ((defined __GNUC__ && __GNUC__ >= 3 && __GNUC_MINOR__ >= 4) || defined __clang__)
#pragma once
-#endif /* __GNUC_PREREQ */
+#endif
#ifndef __MPB_H__INCLUDED__
#define __MPB_H__INCLUDED__
diff --git a/lib/orom/orom.h b/lib/orom/orom.h
index 4492066..16b03a6 100644
--- a/lib/orom/orom.h
+++ b/lib/orom/orom.h
@@ -32,9 +32,9 @@
#include <features.h>
-#if __GNUC_PREREQ(3, 4)
+#if ((defined __GNUC__ && __GNUC__ >= 3 && __GNUC_MINOR__ >= 4) || defined __clang__)
#pragma once
-#endif /* __GNUC_PREREQ */
+#endif
#if defined(__cplusplus)
extern "C" {

View File

@ -0,0 +1,32 @@
From 258a1d128581f185a7a5070f47df06e5c29c9db8 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 30 Aug 2019 13:43:32 -0700
Subject: [PATCH] Include libgen.h
Use XPG version of basename on non gnu libc systems
ideally posix version should be used everywhere but that
would be upstreams choice to make
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/ssieventmonitor.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp
index 0d11975..af7e09c 100644
--- a/tools/ssieventmonitor.cpp
+++ b/tools/ssieventmonitor.cpp
@@ -39,7 +39,9 @@
#include <sys/select.h>
#include <sys/wait.h>
#include <sys/inotify.h>
-
+#ifndef __GLIBC__
+#include <libgen.h>
+#endif
extern "C" {
#include "lib/safeclib/safe_str_lib.h"
}
--
2.23.0

View File

@ -1,872 +0,0 @@
From 3100e23c50e38bff0c2ec77bc30049c113c29414 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 20:44:31 -0700
Subject: [PATCH 1/6] Use pragma once unconditionally
in OE we do not worry about supporting
gcc 3.4 anyway
Upstream-Status: Inappropriate[Bumps required gcc to be > 3.4]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/efi/efi.h | 2 --
lib/engine/ahci.h | 2 --
lib/engine/ahci_cdrom.h | 2 --
lib/engine/ahci_disk.h | 2 --
lib/engine/ahci_multiplier.h | 2 --
lib/engine/ahci_multiplier_phy.h | 2 --
lib/engine/ahci_multiplier_port.h | 2 --
lib/engine/ahci_phy.h | 2 --
lib/engine/ahci_port.h | 2 --
lib/engine/ahci_raid_info.h | 2 --
lib/engine/ahci_tape.h | 2 --
lib/engine/array.h | 2 --
lib/engine/block_device.h | 2 --
lib/engine/cache.h | 2 --
lib/engine/container.h | 2 --
lib/engine/context_manager.h | 2 --
lib/engine/controller.h | 2 --
lib/engine/enclosure.h | 2 --
lib/engine/end_device.h | 2 --
lib/engine/event.h | 2 --
lib/engine/event_manager.h | 2 --
lib/engine/exception.h | 2 --
lib/engine/filesystem.h | 2 --
lib/engine/isci.h | 2 --
lib/engine/isci_cdrom.h | 2 --
lib/engine/isci_disk.h | 2 --
lib/engine/isci_expander.h | 2 --
lib/engine/isci_expander_phy.h | 2 --
lib/engine/isci_expander_port.h | 2 --
lib/engine/isci_phy.h | 2 --
lib/engine/isci_port.h | 2 --
lib/engine/isci_raid_info.h | 2 --
lib/engine/isci_tape.h | 2 --
lib/engine/list.h | 2 --
lib/engine/mdadm_config.h | 2 --
lib/engine/multimedia_device.h | 2 --
lib/engine/nondisk_device.h | 2 --
lib/engine/object.h | 2 --
lib/engine/pci_header.h | 2 --
lib/engine/phy.h | 2 --
lib/engine/port.h | 2 --
lib/engine/raid_device.h | 2 --
lib/engine/raid_info.h | 2 --
lib/engine/remote_port.h | 2 --
lib/engine/routing_device.h | 2 --
lib/engine/session.h | 2 --
lib/engine/session_manager.h | 2 --
lib/engine/storage_device.h | 2 --
lib/engine/stream_device.h | 2 --
lib/engine/string.h | 2 --
lib/engine/unique_id_manager.h | 2 --
lib/engine/utils.h | 2 --
lib/engine/volume.h | 2 --
lib/log/log.h | 2 --
lib/mpb/machine_bytes.h | 2 --
lib/mpb/mpb.h | 2 --
lib/orom/orom.h | 2 --
57 files changed, 114 deletions(-)
diff --git a/lib/efi/efi.h b/lib/efi/efi.h
index 9e7e41b..804e567 100644
--- a/lib/efi/efi.h
+++ b/lib/efi/efi.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __EFI_H__INCLUDED__
#define __EFI_H__INCLUDED__
diff --git a/lib/engine/ahci.h b/lib/engine/ahci.h
index e883d1a..80a9699 100644
--- a/lib/engine/ahci.h
+++ b/lib/engine/ahci.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_H__INCLUDED__
#define __AHCI_H__INCLUDED__
diff --git a/lib/engine/ahci_cdrom.h b/lib/engine/ahci_cdrom.h
index 442f301..d8ca042 100644
--- a/lib/engine/ahci_cdrom.h
+++ b/lib/engine/ahci_cdrom.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_CDROM_H__INCLUDED__
#define __AHCI_CDROM_H__INCLUDED__
diff --git a/lib/engine/ahci_disk.h b/lib/engine/ahci_disk.h
index 7892a53..1bad9ad 100644
--- a/lib/engine/ahci_disk.h
+++ b/lib/engine/ahci_disk.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_DISK_H__INCLUDED__
#define __AHCI_DISK_H__INCLUDED__
diff --git a/lib/engine/ahci_multiplier.h b/lib/engine/ahci_multiplier.h
index d63e9bc..1029af2 100644
--- a/lib/engine/ahci_multiplier.h
+++ b/lib/engine/ahci_multiplier.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_MULTIPLIER_H__INCLUDED__
#define __AHCI_MULTIPLIER_H__INCLUDED__
diff --git a/lib/engine/ahci_multiplier_phy.h b/lib/engine/ahci_multiplier_phy.h
index 58ecebc..2132c23 100644
--- a/lib/engine/ahci_multiplier_phy.h
+++ b/lib/engine/ahci_multiplier_phy.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_MULTIPLIER_PHY_H__INCLUDED__
#define __AHCI_MULTIPLIER_PHY_H__INCLUDED__
diff --git a/lib/engine/ahci_multiplier_port.h b/lib/engine/ahci_multiplier_port.h
index 5ff4cf7..2402473 100644
--- a/lib/engine/ahci_multiplier_port.h
+++ b/lib/engine/ahci_multiplier_port.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_MULTIPLIER_PORT_H__INCLUDED__
#define __AHCI_MULTIPLIER_PORT_H__INCLUDED__
diff --git a/lib/engine/ahci_phy.h b/lib/engine/ahci_phy.h
index e2254e7..a44dae0 100644
--- a/lib/engine/ahci_phy.h
+++ b/lib/engine/ahci_phy.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_PHY_H__INCLUDED__
#define __AHCI_PHY_H__INCLUDED__
diff --git a/lib/engine/ahci_port.h b/lib/engine/ahci_port.h
index f9e3308..03c109b 100644
--- a/lib/engine/ahci_port.h
+++ b/lib/engine/ahci_port.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_PORT_H__INCLUDED__
#define __AHCI_PORT_H__INCLUDED__
diff --git a/lib/engine/ahci_raid_info.h b/lib/engine/ahci_raid_info.h
index e1c81ae..c70e63e 100644
--- a/lib/engine/ahci_raid_info.h
+++ b/lib/engine/ahci_raid_info.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_RAID_INFO_H__INCLUDED__
#define __AHCI_RAID_INFO_H__INCLUDED__
diff --git a/lib/engine/ahci_tape.h b/lib/engine/ahci_tape.h
index cdd9f13..a91fd2c 100644
--- a/lib/engine/ahci_tape.h
+++ b/lib/engine/ahci_tape.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __AHCI_TAPE_H__INCLUDED__
#define __AHCI_TAPE_H__INCLUDED__
diff --git a/lib/engine/array.h b/lib/engine/array.h
index 36fb4a4..0986ce3 100644
--- a/lib/engine/array.h
+++ b/lib/engine/array.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ARRAY_H__INCLUDED__
#define __ARRAY_H__INCLUDED__
diff --git a/lib/engine/block_device.h b/lib/engine/block_device.h
index 4503914..45dd3db 100644
--- a/lib/engine/block_device.h
+++ b/lib/engine/block_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __BLOCK_DEVICE_H__INCLUDED__
#define __BLOCK_DEVICE_H__INCLUDED__
diff --git a/lib/engine/cache.h b/lib/engine/cache.h
index 72cf521..72da20b 100644
--- a/lib/engine/cache.h
+++ b/lib/engine/cache.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3,4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __CACHE_H__INCLUDED__
#define __CACHE_H__INCLUDED__
diff --git a/lib/engine/container.h b/lib/engine/container.h
index 53867b0..c71180c 100644
--- a/lib/engine/container.h
+++ b/lib/engine/container.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3,4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __CONTAINER_H__INCLUDED__
#define __CONTAINER_H__INCLUDED__
diff --git a/lib/engine/context_manager.h b/lib/engine/context_manager.h
index fe9c256..6b4a2e7 100644
--- a/lib/engine/context_manager.h
+++ b/lib/engine/context_manager.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3,4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __CONTEXT_H__INCLUDED__
#define __CONTEXT_H__INCLUDED__
diff --git a/lib/engine/controller.h b/lib/engine/controller.h
index a2f188a..6bd078f 100644
--- a/lib/engine/controller.h
+++ b/lib/engine/controller.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __CONTROLLER_H__INCLUDED__
#define __CONTROLLER_H__INCLUDED__
diff --git a/lib/engine/enclosure.h b/lib/engine/enclosure.h
index 3faef0c..f4b13cc 100644
--- a/lib/engine/enclosure.h
+++ b/lib/engine/enclosure.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ENCLOSURE_H__INCLUDED__
#define __ENCLOSURE_H__INCLUDED__
diff --git a/lib/engine/end_device.h b/lib/engine/end_device.h
index f147e41..269b236 100644
--- a/lib/engine/end_device.h
+++ b/lib/engine/end_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __END_DEVICE_H__INCLUDED__
#define __END_DEVICE_H__INCLUDED__
diff --git a/lib/engine/event.h b/lib/engine/event.h
index cf9bb4f..11a4926 100644
--- a/lib/engine/event.h
+++ b/lib/engine/event.h
@@ -12,9 +12,7 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __EVENT_H__INCLUDED__
#define __EVENT_H__INCLUDED__
diff --git a/lib/engine/event_manager.h b/lib/engine/event_manager.h
index 65007b9..a7a8fc3 100644
--- a/lib/engine/event_manager.h
+++ b/lib/engine/event_manager.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __EVENT_MANAGER_H__INCLUDED__
#define __EVENT_MANAGER_H__INCLUDED__
diff --git a/lib/engine/exception.h b/lib/engine/exception.h
index 171e45d..183ebb5 100644
--- a/lib/engine/exception.h
+++ b/lib/engine/exception.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __EXCEPTION_H__INCLUDED__
#define __EXCEPTION_H__INCLUDED__
diff --git a/lib/engine/filesystem.h b/lib/engine/filesystem.h
index 9c2ce39..b49df07 100644
--- a/lib/engine/filesystem.h
+++ b/lib/engine/filesystem.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __FILESYSTEM_H__INCLUDED__
#define __FILESYSTEM_H__INCLUDED__
diff --git a/lib/engine/isci.h b/lib/engine/isci.h
index ea35cd4..0fa602a 100644
--- a/lib/engine/isci.h
+++ b/lib/engine/isci.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_H__INCLUDED__
#define __ISCI_H__INCLUDED__
diff --git a/lib/engine/isci_cdrom.h b/lib/engine/isci_cdrom.h
index 87b7e7b..25637f9 100644
--- a/lib/engine/isci_cdrom.h
+++ b/lib/engine/isci_cdrom.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_CDROM_H__INCLUDED__
#define __ISCI_CDROM_H__INCLUDED__
diff --git a/lib/engine/isci_disk.h b/lib/engine/isci_disk.h
index 596c3cf..8dd0dae 100644
--- a/lib/engine/isci_disk.h
+++ b/lib/engine/isci_disk.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_DISK_H__INCLUDED__
#define __ISCI_DISK_H__INCLUDED__
diff --git a/lib/engine/isci_expander.h b/lib/engine/isci_expander.h
index ca7c2f1..7dc1920 100644
--- a/lib/engine/isci_expander.h
+++ b/lib/engine/isci_expander.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_EXPANDER_H__INCLUDED__
#define __ISCI_EXPANDER_H__INCLUDED__
diff --git a/lib/engine/isci_expander_phy.h b/lib/engine/isci_expander_phy.h
index c9cd770..d3d2832 100644
--- a/lib/engine/isci_expander_phy.h
+++ b/lib/engine/isci_expander_phy.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_EXPANDER_PHY_H__INCLUDED__
#define __ISCI_EXPANDER_PHY_H__INCLUDED__
diff --git a/lib/engine/isci_expander_port.h b/lib/engine/isci_expander_port.h
index e65a124..4fc9310 100644
--- a/lib/engine/isci_expander_port.h
+++ b/lib/engine/isci_expander_port.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_EXPANDER_PORT_H__INCLUDED__
#define __ISCI_EXPANDER_PORT_H__INCLUDED__
diff --git a/lib/engine/isci_phy.h b/lib/engine/isci_phy.h
index 767a5b2..105c697 100644
--- a/lib/engine/isci_phy.h
+++ b/lib/engine/isci_phy.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_PHY_H__INCLUDED__
#define __ISCI_PHY_H__INCLUDED__
diff --git a/lib/engine/isci_port.h b/lib/engine/isci_port.h
index b80be7f..5ccc151 100644
--- a/lib/engine/isci_port.h
+++ b/lib/engine/isci_port.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_PORT_H__INCLUDED__
#define __ISCI_PORT_H__INCLUDED__
diff --git a/lib/engine/isci_raid_info.h b/lib/engine/isci_raid_info.h
index 1df6477..b0b046a 100644
--- a/lib/engine/isci_raid_info.h
+++ b/lib/engine/isci_raid_info.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_RAID_INFO_H__INCLUDED__
#define __ISCI_RAID_INFO_H__INCLUDED__
diff --git a/lib/engine/isci_tape.h b/lib/engine/isci_tape.h
index 985f767..a2cef2d 100644
--- a/lib/engine/isci_tape.h
+++ b/lib/engine/isci_tape.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ISCI_TAPE_H__INCLUDED__
#define __ISCI_TAPE_H__INCLUDED__
diff --git a/lib/engine/list.h b/lib/engine/list.h
index 9a7c3c3..6395830 100644
--- a/lib/engine/list.h
+++ b/lib/engine/list.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __LIST_H__INCLUDED__
#define __LIST_H__INCLUDED__
diff --git a/lib/engine/mdadm_config.h b/lib/engine/mdadm_config.h
index c94020f..e415b4f 100644
--- a/lib/engine/mdadm_config.h
+++ b/lib/engine/mdadm_config.h
@@ -11,9 +11,7 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __MDADM_CONFIG_H__INCLUDED__
#define __MDADM_CONFIG_H__INCLUDED__
diff --git a/lib/engine/multimedia_device.h b/lib/engine/multimedia_device.h
index 533370e..694e2a5 100644
--- a/lib/engine/multimedia_device.h
+++ b/lib/engine/multimedia_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __MULTIMEDIA_DEVICE_H__INCLUDED__
#define __MULTIMEDIA_DEVICE_H__INCLUDED__
diff --git a/lib/engine/nondisk_device.h b/lib/engine/nondisk_device.h
index 70ebb32..0f00e52 100644
--- a/lib/engine/nondisk_device.h
+++ b/lib/engine/nondisk_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __CHARACTER_DEVICE_H__INCLUDED__
#define __CHARACTER_DEVICE_H__INCLUDED__
diff --git a/lib/engine/object.h b/lib/engine/object.h
index b52d3d3..345d58c 100644
--- a/lib/engine/object.h
+++ b/lib/engine/object.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __OBJECT_H__INCLUDED__
#define __OBJECT_H__INCLUDED__
diff --git a/lib/engine/pci_header.h b/lib/engine/pci_header.h
index 376f296..c5129a0 100644
--- a/lib/engine/pci_header.h
+++ b/lib/engine/pci_header.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __PCI_HEADER_H__INCLUDED__
#define __PCI_HEADER_H__INCLUDED__
diff --git a/lib/engine/phy.h b/lib/engine/phy.h
index f5730a0..c59f7c8 100644
--- a/lib/engine/phy.h
+++ b/lib/engine/phy.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __PHY_H__INCLUDED__
#define __PHY_H__INCLUDED__
diff --git a/lib/engine/port.h b/lib/engine/port.h
index 2f33876..cc48c7c 100644
--- a/lib/engine/port.h
+++ b/lib/engine/port.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3,4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __PORT_H__INCLUDED__
#define __PORT_H__INCLUDED__
diff --git a/lib/engine/raid_device.h b/lib/engine/raid_device.h
index 998e80c..2174162 100644
--- a/lib/engine/raid_device.h
+++ b/lib/engine/raid_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __RAID_DEVICE_H__INCLUDED__
#define __RAID_DEVICE_H__INCLUDED__
diff --git a/lib/engine/raid_info.h b/lib/engine/raid_info.h
index 174698a..302be9b 100644
--- a/lib/engine/raid_info.h
+++ b/lib/engine/raid_info.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __RAID_INFO_H__INCLUDED__
#define __RAID_INFO_H__INCLUDED__
diff --git a/lib/engine/remote_port.h b/lib/engine/remote_port.h
index c086656..4ddfee3 100644
--- a/lib/engine/remote_port.h
+++ b/lib/engine/remote_port.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __REMOTE_PORT_H__INCLUDED__
#define __REMOTE_PORT_H__INCLUDED__
diff --git a/lib/engine/routing_device.h b/lib/engine/routing_device.h
index 5f857a6..284621e 100644
--- a/lib/engine/routing_device.h
+++ b/lib/engine/routing_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ROUTING_DEVICE_H__INCLUDED__
#define __ROUTING_DEVICE_H__INCLUDED__
diff --git a/lib/engine/session.h b/lib/engine/session.h
index a901d1c..3200da1 100644
--- a/lib/engine/session.h
+++ b/lib/engine/session.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __SESSION_H__INCLUDED__
#define __SESSION_H__INCLUDED__
diff --git a/lib/engine/session_manager.h b/lib/engine/session_manager.h
index 7177064..87e16c3 100644
--- a/lib/engine/session_manager.h
+++ b/lib/engine/session_manager.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __SESSION_MANAGER_H__INCLUDED__
#define __SESSION_MANAGER_H__INCLUDED__
diff --git a/lib/engine/storage_device.h b/lib/engine/storage_device.h
index ddeb66f..20bdab2 100644
--- a/lib/engine/storage_device.h
+++ b/lib/engine/storage_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __STORAGE_DEVICE_H__INCLUDED__
#define __STORAGE_DEVICE_H__INCLUDED__
diff --git a/lib/engine/stream_device.h b/lib/engine/stream_device.h
index 9bc111a..b29bd68 100644
--- a/lib/engine/stream_device.h
+++ b/lib/engine/stream_device.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __STREAM_DEVICE_H__INCLUDED__
#define __STREAM_DEVICE_H__INCLUDED__
diff --git a/lib/engine/string.h b/lib/engine/string.h
index 3007dc7..6f348c9 100644
--- a/lib/engine/string.h
+++ b/lib/engine/string.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __STRING_H__INCLUDED__
#define __STRING_H__INCLUDED__
diff --git a/lib/engine/unique_id_manager.h b/lib/engine/unique_id_manager.h
index fe79eac..4a13627 100644
--- a/lib/engine/unique_id_manager.h
+++ b/lib/engine/unique_id_manager.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __UNIQUE_ID_MANAGER_H__INCLUDED__
#define __UNIQUE_ID_MANAGER_H__INCLUDED__
diff --git a/lib/engine/utils.h b/lib/engine/utils.h
index 86c20cf..5525303 100644
--- a/lib/engine/utils.h
+++ b/lib/engine/utils.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __UTILS_H__INCLUDED__
#define __UTILS_H__INCLUDED__
diff --git a/lib/engine/volume.h b/lib/engine/volume.h
index 9a63cbf..3347b31 100644
--- a/lib/engine/volume.h
+++ b/lib/engine/volume.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
// Forward declarations
class Array;
diff --git a/lib/log/log.h b/lib/log/log.h
index c0bd63e..8b5f171 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __LOG_H__INCLUDED__
#define __LOG_H__INCLUDED__
diff --git a/lib/mpb/machine_bytes.h b/lib/mpb/machine_bytes.h
index 7fbb0e9..800b120 100644
--- a/lib/mpb/machine_bytes.h
+++ b/lib/mpb/machine_bytes.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __ENDIAN_H__INCLUDED__
#define __ENDIAN_H__INCLUDED__
diff --git a/lib/mpb/mpb.h b/lib/mpb/mpb.h
index 01782af..c42cdfb 100644
--- a/lib/mpb/mpb.h
+++ b/lib/mpb/mpb.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __MPB_H__INCLUDED__
#define __MPB_H__INCLUDED__
diff --git a/lib/orom/orom.h b/lib/orom/orom.h
index f76e3ee..e10311d 100644
--- a/lib/orom/orom.h
+++ b/lib/orom/orom.h
@@ -15,9 +15,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-#if __GNUC_PREREQ(3, 4)
#pragma once
-#endif /* __GNUC_PREREQ */
#ifndef __OROM_H__INCLUDED__
#define __OROM_H__INCLUDED__
--
2.13.1

View File

@ -0,0 +1,57 @@
From 874da836bc857e5942675c59e19f4fd8ad09b13e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 29 Aug 2019 14:08:19 -0700
Subject: [PATCH 1/4] log: Avoid shadowing functions from std lib
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/log/log.c | 2 +-
lib/log/log.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/log/log.c b/lib/log/log.c
index 7d8e17c..18b67a5 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -82,7 +82,7 @@ enum log_level log_get_level(void) {
}
/* */
-void __log(enum log_level level, const char *message) {
+void _ssiap_log(enum log_level level, const char *message) {
struct tm tm;
struct timeval tv;
diff --git a/lib/log/log.h b/lib/log/log.h
index d94e482..66a707b 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -53,13 +53,13 @@ enum log_level {
};
/* */
-#define log(__level, __message) \
+#define ssiap_log(__level, __message) \
do { if (log_get_level() >= (enum log_level)(__level)) \
- __log(__level, __message); \
+ _ssiap_log(__level, __message); \
} while (0)
#define dlog(__message) \
- log(LOG_DEBUG, __message);
+ ssiap_log(LOG_DEBUG, __message);
/* */
void log_init(enum log_level level, const char *path);
@@ -68,7 +68,7 @@ void log_init(enum log_level level, const char *path);
void log_fini(void);
/* */
-void __log(enum log_level level, const char *message);
+void _ssiap_log(enum log_level level, const char *message);
/* */
enum log_level log_get_level(void);
--
2.23.0

View File

@ -1,39 +0,0 @@
From ea9ecf4bf305f9509d5822b3823658a40162f43c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 25 Jul 2017 19:08:21 -0700
Subject: [PATCH] ssieventmonitor: ordered comparison between pointers and
zero, actually with NULL
Comparing which is large or small between a pointer and NULL
however, looks completely illogical. Ordered comparison of
two valid pointers is legit, but no pointer will be smaller
than NULL , so comparing if a pointer is larger than NULL
simply means if the pointer is not NULL.
Fixes errors found with clang e.g.
| ssieventmonitor.cpp:339:53: error: ordered comparison between pointer and zero ('char *' and 'int')
| if (fgets(nextline, sizeof(nextline) - 1, mdstat) < 0) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/ssieventmonitor.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp
index f04b8f0..7a00122 100644
--- a/tools/ssieventmonitor.cpp
+++ b/tools/ssieventmonitor.cpp
@@ -336,7 +336,7 @@ static int _read_mdstat(int fd)
if (!strncmp(line, "md", 2)) {
if (strstr(line, INACTIVE_STR)) { /* possibly container */
char nextline[1024];
- if (fgets(nextline, sizeof(nextline) - 1, mdstat) < 0) {
+ if (fgets(nextline, sizeof(nextline) - 1, mdstat) != (char *) NULL) {
fclose(mdstat);
return 1;
}
--
2.13.3

View File

@ -1,123 +0,0 @@
From 1338ee4e69c465f8f381ec3bfe5058080236edba Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 22:08:35 -0700
Subject: [PATCH 2/6] Convert macros into functions
This helps in fixing the security format warnings
add -fno-builtin-log
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/Makefile.am | 3 ++-
lib/log/Makefile.am | 2 ++
lib/log/log.h | 34 +++++++++++++++++++++-------------
src/Makefile.am | 3 ++-
4 files changed, 27 insertions(+), 15 deletions(-)
Index: ssiapi.1.0.1/lib/engine/Makefile.am
===================================================================
--- ssiapi.1.0.1.orig/lib/engine/Makefile.am
+++ ssiapi.1.0.1/lib/engine/Makefile.am
@@ -113,4 +113,5 @@ libengine_la_SOURCES = \
libengine_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
- -I$(top_srcdir)/lib
+ -I$(top_srcdir)/lib \
+ -fno-builtin-log
Index: ssiapi.1.0.1/lib/log/Makefile.am
===================================================================
--- ssiapi.1.0.1.orig/lib/log/Makefile.am
+++ ssiapi.1.0.1/lib/log/Makefile.am
@@ -5,3 +5,5 @@ noinst_LTLIBRARIES = liblog.la
liblog_la_SOURCES = \
log.c \
log.h
+
+liblog_la_CPPFLAGS = -fno-builtin-log
Index: ssiapi.1.0.1/lib/log/log.h
===================================================================
--- ssiapi.1.0.1.orig/lib/log/log.h
+++ ssiapi.1.0.1/lib/log/log.h
@@ -23,7 +23,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIG
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
-
+#include <stdarg.h>
/* */
enum log_level {
LOG_FIRST = 0,
@@ -37,26 +37,34 @@ enum log_level {
};
/* */
-#define log(__level, __format, ...) \
- do { if (log_get_level() >= (enum log_level)(__level)) \
- __log(__level, __format, ## __VA_ARGS__); \
- } while (0)
-
-#define dlog(__format, ...) \
- log(LOG_DEBUG, __format, ## __VA_ARGS__);
+void __log(enum log_level level, const char *format, ...)
+ __attribute__((format(printf, 2, 3)));
/* */
-void log_init(enum log_level level, const char *path);
+enum log_level log_get_level(void);
/* */
-void log_fini(void);
-
+static inline void log(enum log_level __level, const char* __format, ...) {
+ va_list ap;
+ va_start(ap, __format);
+ do {
+ if (log_get_level() >= (enum log_level)(__level))
+ __log(__level, __format, ap);
+ } while (0);
+ va_end(ap);
+}
+
+static inline void dlog(const char* __format, ...) {
+ va_list ap;
+ va_start(ap, __format);
+ log(LOG_DEBUG, __format, ap);
+ va_end(ap);
+}
/* */
-void __log(enum log_level level, const char *format, ...)
- __attribute__((format(printf, 2, 3)));
+void log_init(enum log_level level, const char *path);
/* */
-enum log_level log_get_level(void);
+void log_fini(void);
/* */
void log_set_level(enum log_level level);
Index: ssiapi.1.0.1/src/Makefile.am
===================================================================
--- ssiapi.1.0.1.orig/src/Makefile.am
+++ ssiapi.1.0.1/src/Makefile.am
@@ -7,7 +7,8 @@ lib_LTLIBRARIES = libssi.la
libssi_la_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
- -I$(top_srcdir)/lib
+ -I$(top_srcdir)/lib \
+ -fno-builtin-log
libssi_la_LDFLAGS = \
$(SGUTILS_LDFLAGS) \
Index: ssiapi.1.0.1/lib/efi/Makefile.am
===================================================================
--- ssiapi.1.0.1.orig/lib/efi/Makefile.am
+++ ssiapi.1.0.1/lib/efi/Makefile.am
@@ -5,3 +5,4 @@ noinst_LTLIBRARIES = libefi.la
libefi_la_SOURCES = \
efi.cpp \
efi.h
+libefi_la_CPPFLAGS = -fno-builtin-log

View File

@ -0,0 +1,54 @@
From 01a75b23382fd042673d1f00fce708ba6c67d05a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 30 Aug 2019 13:12:54 -0700
Subject: [PATCH] Use stangard int types
__unitn_* are internal to GNU libc lets use portable types
Fixes
error: unknown type name '__uint8_t'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/end_device.cpp | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/engine/end_device.cpp b/lib/engine/end_device.cpp
index 5a66de9..da078bf 100644
--- a/lib/engine/end_device.cpp
+++ b/lib/engine/end_device.cpp
@@ -36,6 +36,7 @@
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/hdreg.h>
+#include <stdint.h>
#include <unistd.h>
#include <linux/fs.h>
#include <climits>
@@ -90,20 +91,20 @@ using boost::shared_ptr;
struct AtaCommand
{
- __uint8_t command;
- __uint8_t obsolete1;
- __uint8_t obsolete2;
- __uint8_t transportDependent;
+ uint8_t command;
+ uint8_t obsolete1;
+ uint8_t obsolete2;
+ uint8_t transportDependent;
};
struct AtaIdentifyCall
{
AtaCommand command;
- __uint16_t data[256];
+ uint16_t data[256];
};
namespace {
- __uint16_t swap(__uint16_t value)
+ uint16_t swap(uint16_t value)
{
return (value >> 8) | (value << 8);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +0,0 @@
From 781288d6307002cce70ddafb6efb200b7f60294d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 22:12:43 -0700
Subject: [PATCH 3/6] Replace canonicalize_file_name with realpath() API
Fixed build on musl where canonicalize_file_name is not implemented
filesystem.cpp:46:15: error: 'canonicalize_file_name' was not declared in this scope
char *p = canonicalize_file_name(path);
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/filesystem.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/engine/filesystem.cpp b/lib/engine/filesystem.cpp
index b99257e..6064837 100644
--- a/lib/engine/filesystem.cpp
+++ b/lib/engine/filesystem.cpp
@@ -43,7 +43,7 @@ void CanonicalPath::__canonicalize_path_name(const char *path)
if (path == 0) {
throw E_NULL_POINTER;
}
- char *p = canonicalize_file_name(path);
+ char *p = realpath(path, NULL);
assign(p);
if (p) {
free(p);
--
2.13.1

View File

@ -0,0 +1,47 @@
From 24e0f55c07080a59907c190a315e279f7b2355e5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 29 Aug 2019 14:25:02 -0700
Subject: [PATCH 3/4] engine: Define discover(const String &path) in base class
this fixes the confusion that compiler may have when inheriting two
different classes where each of them defines discover() virtual function
but with different signatures
Remove ununsed orom_vmd
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/storage_object.h | 3 +++
lib/engine/vmd_raid_info.h | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/engine/storage_object.h b/lib/engine/storage_object.h
index f1feb62..9c1d3d8 100644
--- a/lib/engine/storage_object.h
+++ b/lib/engine/storage_object.h
@@ -123,6 +123,9 @@ public:
virtual void discover() {
throw E_INVALID_OPERATION;
}
+ virtual void discover(const String &path) {
+ throw E_INVALID_OPERATION;
+ }
virtual void addToSession(const boost::shared_ptr<Session>& pSession) = 0;
};
diff --git a/lib/engine/vmd_raid_info.h b/lib/engine/vmd_raid_info.h
index 2bea839..cc6ffbe 100644
--- a/lib/engine/vmd_raid_info.h
+++ b/lib/engine/vmd_raid_info.h
@@ -53,8 +53,6 @@ public:
return SSI_ControllerTypeVMD;
}
-private:
- struct orom_info orom_vmd;
};
#endif /* __VMD_RAID_INFO_H__INCLUDED__ */
--
2.23.0

View File

@ -0,0 +1,43 @@
From c817db76bb63b872fe2069e3c2449ac18affe8c1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 30 Aug 2019 13:17:38 -0700
Subject: [PATCH] replace canonicalize_file_name with realpath
Use 'realpath()' (BSD, POSIX) instead of
'canonicalize_file_name()' (GNU extension).
Fixes
error: use of undeclared identifier 'canonicalize_file_name'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/filesystem.cpp | 2 +-
tools/ssieventmonitor.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/engine/filesystem.cpp b/lib/engine/filesystem.cpp
index bf5a776..194ab8a 100644
--- a/lib/engine/filesystem.cpp
+++ b/lib/engine/filesystem.cpp
@@ -54,7 +54,7 @@ void CanonicalPath::__canonicalize_path_name(const char *path)
if (path == NULL) {
throw E_NULL_POINTER;
}
- char *p = canonicalize_file_name(path);
+ char *p = realpath(path, (char *)0);
assign(p);
if (p) {
free(p);
diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp
index 80791fd..3eed877 100644
--- a/tools/ssieventmonitor.cpp
+++ b/tools/ssieventmonitor.cpp
@@ -120,7 +120,7 @@ static int _exec_ssimsg(void)
int status;
switch (pid) {
case 0: {
- cp = canonicalize_file_name("/proc/self/exe");
+ cp = realpath("/proc/self/exe", (char *)0);
if (cp) {
strcpy_s(buffer, sizeof(buffer), cp);
free(cp);

View File

@ -0,0 +1,33 @@
From 98fad8128d0f3b65619827ee5d65f7767b080c4c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 29 Aug 2019 14:35:16 -0700
Subject: [PATCH 4/4] Do not override flags coming from build environment
e.g. we need some optimization level turned on when security flags are enabled
without this change, the build would fail
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 34e41ea..9bd0fe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,9 +16,9 @@ AM_INIT_AUTOMAKE(ssi, ${VERSION})
AM_CONFIG_HEADER(config.h)
dnl Set the language we use
-CPPFLAGS="-g3 -gdwarf-2 -Wall -Werror -fvisibility=hidden -D_GNU_SOURCE -O3 -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fPIC"
-CFLAGS="-std=gnu99 -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fPIC"
-CXXFLAGS="-std=gnu++98 -fvisibility-inlines-hidden -O3 -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fPIC"
+#CPPFLAGS="-g3 -gdwarf-2 -Wall -Werror -fvisibility=hidden -D_GNU_SOURCE -O3 -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fPIC"
+#CFLAGS="-std=gnu99 -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fPIC"
+#CXXFLAGS="-std=gnu++98 -fvisibility-inlines-hidden -O3 -fstack-protector -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fPIC"
dnl Automake 1.11 - silent build rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
--
2.23.0

View File

@ -1,54 +0,0 @@
From 04e8b99d8195a0e39982ecd27802421610633724 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 22:18:31 -0700
Subject: [PATCH 4/6] engine: Fix indentation and missing semi-colon
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/mdadm_config.cpp | 5 +++--
lib/engine/unique_id_manager.cpp | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/engine/mdadm_config.cpp b/lib/engine/mdadm_config.cpp
index 1914ddc..e40c2c7 100644
--- a/lib/engine/mdadm_config.cpp
+++ b/lib/engine/mdadm_config.cpp
@@ -118,9 +118,10 @@ void check_configuration()
attr >> config;
configOk = correct_config(config);
} catch (Exception ex) {
- if (ex != E_NOT_FOUND)
+ if (ex != E_NOT_FOUND) {
dlog("Warning: mdadm config file cannot be read, new one will be written");
backup = false;
+ }
}
if (configOk && monitor_running()) {
@@ -134,7 +135,7 @@ void check_configuration()
dlog("Warning: failed to update mdadm.conf");
}
if (restart_monitor() == 0)
- dlog("Monitor restarted successfully")
+ dlog("Monitor restarted successfully");
else
dlog("Error starting Monitor");
}
diff --git a/lib/engine/unique_id_manager.cpp b/lib/engine/unique_id_manager.cpp
index 99c153c..87d6ddc 100644
--- a/lib/engine/unique_id_manager.cpp
+++ b/lib/engine/unique_id_manager.cpp
@@ -185,7 +185,7 @@ void UniqueIdManager::refresh()
keyFile >> keyList;
keyList += "\n";
} catch (...) {
- dlog("ssi.keys file missing")
+ dlog("ssi.keys file missing");
/* no file? that's ok */
}
/* process the list to update IdCaches */
--
2.13.1

View File

@ -0,0 +1,25 @@
From e90101128dfe75b9b1a0575a0179d211f677e6ad Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 30 Aug 2019 13:19:50 -0700
Subject: [PATCH] include limits.h
Fixes
error: use of undeclared identifier 'PATH_MAX'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/ssieventmonitor.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp
index 3eed877..0d11975 100644
--- a/tools/ssieventmonitor.cpp
+++ b/tools/ssieventmonitor.cpp
@@ -34,6 +34,7 @@
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
+#include <limits.h>
#include <sys/fcntl.h>
#include <sys/select.h>
#include <sys/wait.h>

View File

@ -0,0 +1,228 @@
From 3ec4eaf1688e413e8b5cb433148a3bc6e7987606 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 29 Aug 2019 15:10:03 -0700
Subject: [PATCH] enable out of source tree builds
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/efi/Makefile.am | 2 +-
lib/engine/Makefile.am | 2 +-
lib/orom/Makefile.am | 2 +-
lib/safeclib/Makefile.am | 2 +-
src/Makefile.am | 16 ++++++++--------
tools/Makefile.am | 10 +++++-----
ut/Makefile.am | 36 ++++++++++++++++++------------------
7 files changed, 35 insertions(+), 35 deletions(-)
--- a/lib/efi/Makefile.am
+++ b/lib/efi/Makefile.am
@@ -7,6 +7,6 @@ libefi_la_SOURCES = \
efi.h
libefi_la_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
--- a/lib/engine/Makefile.am
+++ b/lib/engine/Makefile.am
@@ -123,6 +123,7 @@ libengine_la_SOURCES = \
volume.h
libengine_la_CPPFLAGS = \
+ -I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
--- a/lib/orom/Makefile.am
+++ b/lib/orom/Makefile.am
@@ -7,6 +7,6 @@ liborom_la_SOURCES = \
orom.h
liborom_la_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
--- a/lib/safeclib/Makefile.am
+++ b/lib/safeclib/Makefile.am
@@ -37,7 +37,7 @@ libsafec_la_SOURCES = \
strtok_s.c
libsafec_la_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-Wno-unused-variable
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = nostdinc
lib_LTLIBRARIES = libssi.la
libssi_la_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib \
-DBOOST_NO_USER_CONFIG
@@ -46,10 +46,10 @@ libssi_la_SOURCES =
templates.h \
volume.cpp
-libssi_la_LIBADD = \
- ../lib/efi/libefi.la \
- ../lib/log/liblog.la \
- ../lib/orom/liborom.la \
- ../lib/mpb/libmpb.la \
- ../lib/engine/libengine.la \
- ../lib/safeclib/libsafec.la
+libssi_la_LIBADD = \
+ $(top_builddir)/lib/efi/libefi.la \
+ $(top_builddir)/lib/log/liblog.la \
+ $(top_builddir)/lib/orom/liborom.la \
+ $(top_builddir)/lib/mpb/libmpb.la \
+ $(top_builddir)/lib/engine/libengine.la \
+ $(top_builddir)/lib/safeclib/libsafec.la
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -6,17 +6,18 @@ ssimsg_SOURCES =
ssimsg.cpp
ssimsg_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
-ssieventmonitor_SOURCES = \
+ssieventmonitor_SOURCES = \
ssieventmonitor.cpp
-ssieventmonitor_CPPFLAGS = \
+ssieventmonitor_CPPFLAGS = \
+ -I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
ssieventmonitor_LDADD = \
- $(top_srcdir)/lib/safeclib/libsafec.la
+ $(top_builddir)/lib/safeclib/libsafec.la
--- a/ut/Makefile.am
+++ b/ut/Makefile.am
@@ -8,81 +8,81 @@ ut_events_SOURCES = \
ut_events.cpp
ut_events_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include
ut_events_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_volume_SOURCES = \
ut_volume.cpp
ut_volume_CPPFLAGS = \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include
ut_volume_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_session_SOURCES = \
ut_session.cpp
ut_session_CPPFLAGS = \
- -g3 -I$(top_srcdir) \
+ -g3 -I$(top_builddir) \
-I$(top_srcdir)/include
ut_session_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_info_SOURCES = \
ut_info.cpp
ut_info_CPPFLAGS = \
- -g3 -I$(top_srcdir) \
+ -g3 -I$(top_builddir) \
-I$(top_srcdir)/include
ut_info_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_markasspare_SOURCES = \
ut_markasspare.cpp
ut_markasspare_CPPFLAGS = \
- -g3 -I$(top_srcdir) \
+ -g3 -I$(top_builddir) \
-I$(top_srcdir)/include
ut_markasspare_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_migration_SOURCES = \
ut_migration.cpp
ut_migration_CPPFLAGS = \
- -g3 -I$(top_srcdir) \
+ -g3 -I$(top_builddir) \
-I$(top_srcdir)/include
ut_migration_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_phy_SOURCES = \
ut_phy.cpp
ut_phy_CPPFLAGS = \
- -g3 -I$(top_srcdir) \
+ -g3 -I$(top_builddir) \
-I$(top_srcdir)/include
ut_phy_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_initialize_volume_SOURCES = \
ut_initialize_volume.cpp
ut_initialize_volume_CPPFLAGS = \
- -g3 -I$(top_srcdir) \
+ -g3 -I$(top_builddir) \
-I$(top_srcdir)/include
ut_initialize_volume_LDADD = \
- ../src/libssi.la
+ $(top_builddir)/src/libssi.la
ut_filesystem_SOURCES = \
ut_filesystem.cpp \
@@ -92,7 +92,7 @@ ut_filesystem_SOURCES = \
ut_filesystem_CPPFLAGS = \
-iquote $(top_srcdir)/lib/engine \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include
ut_string_SOURCES = \
@@ -103,6 +103,6 @@ ut_string_SOURCES = \
ut_string_CPPFLAGS = \
-iquote $(top_srcdir)/lib/engine \
- -I$(top_srcdir) \
+ -I$(top_builddir) \
-I$(top_srcdir)/include

View File

@ -1,40 +0,0 @@
From a2e3a2e332c406ea3c56a8d74b61978107df68e6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 22:23:08 -0700
Subject: [PATCH 5/6] engine: Define SENTINEL
Fix warnings with gcc7
test.cpp:12: warning: missing sentinel in function call
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
lib/engine/utils.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/engine/utils.cpp b/lib/engine/utils.cpp
index 44579a1..8812a8c 100644
--- a/lib/engine/utils.cpp
+++ b/lib/engine/utils.cpp
@@ -35,7 +35,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "filesystem.h"
#include "utils.h"
#include "log/log.h"
-
+#define SENTINEL (const char *)0
/**
* @brief capture shell output as binary data
*
@@ -139,7 +139,7 @@ int shell(const String &s)
* Before switching into new executable close all non standard
* file handlers.*/
close_parent_fds();
- execl("/bin/sh", "sh", "-c", cmd.get(), NULL);
+ execl("/bin/sh", "sh", "-c", cmd.get(), SENTINEL);
/* If we're here then execl failed*/
exit(-1);
break;
--
2.13.1

View File

@ -1,40 +0,0 @@
From df1d56d6b6a6b15d0137619eb8a4b623de6c9633 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 16 Jun 2017 22:28:59 -0700
Subject: [PATCH 6/6] tools: Add missing includes and use realpath() instead of
canonicalize_file_name
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/ssieventmonitor.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/ssieventmonitor.cpp b/tools/ssieventmonitor.cpp
index 0553386..f04b8f0 100644
--- a/tools/ssieventmonitor.cpp
+++ b/tools/ssieventmonitor.cpp
@@ -18,7 +18,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
-#include <sys/fcntl.h>
+#include <limits.h>
+#include <fcntl.h>
+#include <libgen.h>
#include <sys/select.h>
#include <sys/wait.h>
#include <sys/inotify.h>
@@ -99,7 +101,7 @@ static int _exec_ssimsg(void)
int status;
switch (pid) {
case 0: {
- cp = canonicalize_file_name("/proc/self/exe");
+ cp = realpath("/proc/self/exe", NULL);
if (cp) {
strcpy(buffer, cp);
free(cp);
--
2.13.1

View File

@ -1,21 +0,0 @@
Do not override flags thereby respect the flags coming from environment,
e.g. we need some optimization level turned on when security flags are enabled
without this change, the build would fail
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: ssiapi.1.0.1/configure.ac
===================================================================
--- ssiapi.1.0.1.orig/configure.ac
+++ ssiapi.1.0.1/configure.ac
@@ -15,11 +15,6 @@ AC_SUBST(VERSION)
AM_INIT_AUTOMAKE(ssi, ${VERSION})
AM_CONFIG_HEADER(config.h)
-dnl Set the language we use
-CPPFLAGS="-g3 -gdwarf-2 -Wall -Werror -D_GNU_SOURCE"
-CFLAGS="-std=gnu99"
-CXXFLAGS="-std=gnu++98"
-
dnl Automake 1.11 - silent build rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

View File

@ -1,35 +0,0 @@
SUMMARY = "Intel RSTe with Linux OS SSI API Library"
DESCRIPTION = "Intel Rapid Storage Technology enterprise with Linux OS* Standard Storage Interface API Library. \
The library allows user to manage storage devices including creating and managing Raid arrays on systems with Intel chipset."
HOMEPAGE = "http://irstessi.sourceforge.net/"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=0413ff365e0bd733c4869a6797551c6f"
DEPENDS += "sg3-utils"
SRC_URI = "http://sourceforge.net/projects/irstessi/files/${BPN}.${PV}.tgz \
file://0001-Use-pragma-once-unconditionally.patch \
file://0002-Convert-macros-into-functions.patch \
file://0003-Replace-canonicalize_file_name-with-realpath-API.patch \
file://0004-engine-Fix-indentation-and-missing-semi-colon.patch \
file://0005-engine-Define-SENTINEL.patch \
file://0006-tools-Add-missing-includes-and-use-realpath-instead-.patch \
file://configure-cflags.patch \
file://0001-ssieventmonitor-ordered-comparison-between-pointers-.patch \
"
SRC_URI[md5sum] = "02f16d7cbd30d28034093212906591f5"
SRC_URI[sha256sum] = "e10d283b0f211afb8ebd0bde87c097769613d30a052cdf164753e35e803264c7"
S ="${WORKDIR}/${BPN}.${PV}"
inherit autotools-brokensep
CXXFLAGS="-std=gnu++98 -D_GNU_SOURCE"
do_configure_prepend(){
./autogen.sh
}
RDEPENDS_${PN} += "mdadm"

View File

@ -0,0 +1,36 @@
SUMMARY = "Intel RSTe with Linux OS SSI API Library"
DESCRIPTION = "Intel Rapid Storage Technology enterprise with Linux OS* Standard Storage Interface API Library. \
The library allows user to manage storage devices including creating and managing Raid arrays on systems with Intel chipset."
HOMEPAGE = "http://irstessi.sourceforge.net/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=9d701a2fbb56039fd64afb2262008ddb"
DEPENDS += "sg3-utils"
SRC_URI = "http://sourceforge.net/projects/irstessi/files/${BPN}.${PV}.tgz \
file://0001-log-Avoid-shadowing-functions-from-std-lib.patch \
file://0002-boost-Backport-clang-support.patch \
file://0003-engine-Define-discover-const-String-path-in-base-cla.patch \
file://0004-Do-not-override-flags-coming-from-build-environment.patch \
file://0005-enable-out-of-source-tree-builds.patch \
file://0001-Don-t-use-__GNUC_PREREQ.patch \
file://0002-Use-stangard-int-types.patch \
file://0003-replace-canonicalize_file_name-with-realpath.patch \
file://0004-include-limits.h.patch \
file://0001-Include-libgen.h.patch \
"
SRC_URI[md5sum] = "d06c9b426437a7697d77266e9835b520"
SRC_URI[sha256sum] = "59daab29363d6e9f07c524029c4239653cfbbee6b0e57fd75df62499728dad8a"
S ="${WORKDIR}/${BPN}.${PV}"
inherit autotools
do_configure_prepend(){
${S}/autogen.sh
}
RDEPENDS_${PN} += "mdadm"