forked from pool/ipmitool
Thomas Renninger
570b85101b
- Update to latest ipmitool source code commit 9020b67347f46554009591ae91e4fa8875c65dfa Date: Tue Jan 12 21:16:37 2016 +0500 - Fix memleak: bnc#968105 Add: ipmitool-sol_memleak.patch OBS-URL: https://build.opensuse.org/request/show/361388 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=35
176 lines
5.4 KiB
Diff
176 lines
5.4 KiB
Diff
Fix compile issues
|
|
|
|
Use _XOPEN_SOURCE 500 in ipmi_main to get getpass defined.
|
|
from manpage:
|
|
getpass():
|
|
Since glibc 2.2.2:
|
|
_BSD_SOURCE ||
|
|
(_XOPEN_SOURCE >= 500 ||
|
|
_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&
|
|
!(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
|
|
|
|
and more compiler warning fixing stuff...
|
|
|
|
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
|
|
Index: ipmitool-1.8.16/lib/ipmi_chassis.c
|
|
===================================================================
|
|
--- ipmitool-1.8.16.orig/lib/ipmi_chassis.c 2015-11-22 13:50:54.000000000 +0100
|
|
+++ ipmitool-1.8.16/lib/ipmi_chassis.c 2016-02-25 13:25:49.392010059 +0100
|
|
@@ -30,6 +30,7 @@
|
|
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
*/
|
|
|
|
+#include <config.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
Index: ipmitool-1.8.16/lib/ipmi_main.c
|
|
===================================================================
|
|
--- ipmitool-1.8.16.orig/lib/ipmi_main.c 2015-11-22 13:50:54.000000000 +0100
|
|
+++ ipmitool-1.8.16/lib/ipmi_main.c 2016-02-25 13:25:49.400010253 +0100
|
|
@@ -29,7 +29,7 @@
|
|
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
|
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
*/
|
|
-#define _XOPEN_SOURCE 700
|
|
+#define _XOPEN_SOURCE 500
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
Index: ipmitool-1.8.16/lib/ipmi_sel.c
|
|
===================================================================
|
|
--- ipmitool-1.8.16.orig/lib/ipmi_sel.c 2016-02-25 13:25:35.059202081 +0100
|
|
+++ ipmitool-1.8.16/lib/ipmi_sel.c 2016-02-25 13:25:49.408010606 +0100
|
|
@@ -2399,18 +2399,18 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
evt.sel_type.standard_type.timestamp;
|
|
|
|
/* skip timestamp */
|
|
- cursor = index((const char *)cursor, ';');
|
|
+ cursor = strchr((const char *)cursor, ';');
|
|
cursor++;
|
|
|
|
/* FIXME: parse originator */
|
|
evt.sel_type.standard_type.gen_id = 0x0020;
|
|
|
|
/* skip originator info */
|
|
- cursor = index((const char *)cursor, ';');
|
|
+ cursor = strchr((const char *)cursor, ';');
|
|
cursor++;
|
|
|
|
/* Get sensor type */
|
|
- cursor = index((const char *)cursor, '(');
|
|
+ cursor = strchr((const char *)cursor, '(');
|
|
cursor++;
|
|
|
|
errno = 0;
|
|
@@ -2421,7 +2421,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
status = (-1);
|
|
break;
|
|
}
|
|
- cursor = index((const char *)cursor, ',');
|
|
+ cursor = strchr((const char *)cursor, ',');
|
|
cursor++;
|
|
|
|
errno = 0;
|
|
@@ -2434,7 +2434,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
}
|
|
|
|
/* skip to event type info */
|
|
- cursor = index((const char *)cursor, ':');
|
|
+ cursor = strchr((const char *)cursor, ':');
|
|
cursor++;
|
|
|
|
errno = 0;
|
|
@@ -2447,7 +2447,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
}
|
|
|
|
/* skip to event dir info */
|
|
- cursor = index((const char *)cursor, '(');
|
|
+ cursor = strchr((const char *)cursor, '(');
|
|
cursor++;
|
|
if (*cursor == 'a') {
|
|
evt.sel_type.standard_type.event_dir = 0;
|
|
@@ -2455,7 +2455,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
evt.sel_type.standard_type.event_dir = 1;
|
|
}
|
|
/* skip to data info */
|
|
- cursor = index((const char *)cursor, ' ');
|
|
+ cursor = strchr((const char *)cursor, ' ');
|
|
cursor++;
|
|
|
|
if (evt.sel_type.standard_type.sensor_type == 0xF0) {
|
|
@@ -2474,7 +2474,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
}
|
|
|
|
/* Get to previous state */
|
|
- cursor = index((const char *)cursor, 'M');
|
|
+ cursor = strchr((const char *)cursor, 'M');
|
|
cursor++;
|
|
|
|
/* Set previous state */
|
|
@@ -2488,7 +2488,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
}
|
|
|
|
/* Get to current state */
|
|
- cursor = index((const char *)cursor, 'M');
|
|
+ cursor = strchr((const char *)cursor, 'M');
|
|
cursor++;
|
|
|
|
/* Set current state */
|
|
@@ -2502,7 +2502,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
}
|
|
|
|
/* skip to cause */
|
|
- cursor = index((const char *)cursor, '=');
|
|
+ cursor = strchr((const char *)cursor, '=');
|
|
cursor++;
|
|
errno = 0;
|
|
evt.sel_type.standard_type.event_data[1] |=
|
|
@@ -2521,7 +2521,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
status = (-1);
|
|
break;
|
|
}
|
|
- cursor = index((const char *)cursor, ' ');
|
|
+ cursor = strchr((const char *)cursor, ' ');
|
|
cursor++;
|
|
|
|
errno = 0;
|
|
@@ -2533,7 +2533,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
|
|
break;
|
|
}
|
|
|
|
- cursor = index((const char *)cursor, ' ');
|
|
+ cursor = strchr((const char *)cursor, ' ');
|
|
cursor++;
|
|
|
|
errno = 0;
|
|
Index: ipmitool-1.8.16/src/ipmishell.c
|
|
===================================================================
|
|
--- ipmitool-1.8.16.orig/src/ipmishell.c 2015-11-22 13:50:54.000000000 +0100
|
|
+++ ipmitool-1.8.16/src/ipmishell.c 2016-02-25 13:25:49.412010855 +0100
|
|
@@ -30,6 +30,9 @@
|
|
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
*/
|
|
|
|
+/* strdup needs this */
|
|
+#define _XOPEN_SOURCE 500
|
|
+
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
Index: ipmitool-1.8.16/lib/log.c
|
|
===================================================================
|
|
--- ipmitool-1.8.16.orig/lib/log.c 2015-11-22 13:50:54.000000000 +0100
|
|
+++ ipmitool-1.8.16/lib/log.c 2016-02-25 13:25:49.420011423 +0100
|
|
@@ -30,6 +30,9 @@
|
|
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
*/
|
|
|
|
+/* strdup needs this */
|
|
+#define _XOPEN_SOURCE 500
|
|
+
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|