|
From: Zdenek S. <st...@us...> - 2016-03-13 11:13:52
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ipmitool".
The branch, master has been updated
via cacdd1b6ec9bf04ea7dcaf6d66cc5cacbce56aa7 (commit)
via eb5c73c04e0e720cc6a763725796841aa079a8af (commit)
from 55b024f5736e83c4b9fce625aa0c918484253aa5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cacdd1b6ec9bf04ea7dcaf6d66cc5cacbce56aa7
Author: Jens Nyberg <jen...@er...>
Date: Thu Mar 10 08:42:35 2016 +0000
ID:431 - Fix correct interpretation of led states
The LED state bits are not mutually exclusive. Bit [0] says LEDs can be
controlled locally and the state bit [1] says wheter the default local
settings or the override settings are used. This means that both bits can be
set at the same time.
Bit [2], the lamp test, indicates wether the test is in progress and logically
works the same as [1].
If bit [0] is not set then bit [1] and [2] has no meaning.
Signed-off-by: Jens Nyberg <jen...@er...>
diff --git a/lib/ipmi_picmg.c b/lib/ipmi_picmg.c
index f47577e..70f845d 100644
--- a/lib/ipmi_picmg.c
+++ b/lib/ipmi_picmg.c
@@ -1280,49 +1280,53 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
}
printf("LED states: %x ", rsp->data[1] );
- if (rsp->data[1] == 0x1)
- printf("[LOCAL CONTROL]\n");
- else if (rsp->data[1] == 0x2)
- printf("[OVERRIDE]\n");
- else if (rsp->data[1] == 0x4)
- printf("[LAMPTEST]\n");
- else
- printf("\n");
+
+ if (!(rsp->data[1] & 0x1)) {
+ printf("[NO LOCAL CONTROL]\n");
+ return 0;
+ }
+
+ printf("[LOCAL CONTROL");
+
+ if (rsp->data[1] & 0x2) {
+ printf("|OVERRIDE");
+ }
+
+ if (rsp->data[1] & 0x4) {
+ printf("|LAMPTEST");
+ }
+
+ printf("]\n");
printf(" Local Control function: %x ", rsp->data[2] );
- if (rsp->data[2] == 0x0)
+ if (rsp->data[2] == 0x0) {
printf("[OFF]\n");
- else if (rsp->data[2] == 0xff)
+ } else if (rsp->data[2] == 0xff) {
printf("[ON]\n");
- else
+ } else {
printf("[BLINKING]\n");
+ }
printf(" Local Control On-Duration: %x\n", rsp->data[3] );
printf(" Local Control Color: %x [%s]\n", rsp->data[4], led_color_str[ rsp->data[4] ]);
/* override state or lamp test */
- if (rsp->data[1] == 0x02) {
+ if (rsp->data[1] & 0x02) {
printf(" Override function: %x ", rsp->data[5] );
- if (rsp->data[2] == 0x0)
+ if (rsp->data[2] == 0x0) {
printf("[OFF]\n");
- else if (rsp->data[2] == 0xff)
+ } else if (rsp->data[2] == 0xff) {
printf("[ON]\n");
- else
+ } else {
printf("[BLINKING]\n");
+ }
printf(" Override On-Duration: %x\n", rsp->data[6] );
printf(" Override Color: %x [%s]\n", rsp->data[7], led_color_str[ rsp->data[7] ]);
- }else if (rsp->data[1] == 0x06) {
- printf(" Override function: %x ", rsp->data[5] );
- if (rsp->data[2] == 0x0)
- printf("[OFF]\n");
- else if (rsp->data[2] == 0xff)
- printf("[ON]\n");
- else
- printf("[BLINKING]\n");
- printf(" Override On-Duration: %x\n", rsp->data[6] );
- printf(" Override Color: %x [%s]\n", rsp->data[7], led_color_str[ rsp->data[7] ]);
+ }
+
+ if (rsp->data[1] & 0x04) {
printf(" Lamp test duration: %x\n", rsp->data[8] );
}
commit eb5c73c04e0e720cc6a763725796841aa079a8af
Author: Zdenek Styblik <st...@tu...>
Date: Sun Mar 13 11:40:10 2016 +0100
ID:355 - Add macros and #include and reduce number of warnings
Commit adds macros and #include in order to bring down the number of `warning:
implicit declaration of function 'X' [-Wimplicit-function-declaration]`
warnings.
diff --git a/lib/helper.c b/lib/helper.c
index b9316c4..022a9c9 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -30,6 +30,11 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#define _POSIX_SOURCE
+#define /* glibc 2.19 and earlier */ _BSD_SOURCE || \
+ /* Since glibc 2.20 */_DEFAULT_SOURCE || \
+ _XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
+ /* Since glibc 2.10: */ _POSIX_C_SOURCE >= 200112L \
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/lib/ipmi_chassis.c b/lib/ipmi_chassis.c
index d4e88ee..50e8c50 100644
--- a/lib/ipmi_chassis.c
+++ b/lib/ipmi_chassis.c
@@ -29,6 +29,8 @@
* 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 _SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE >= 1 || \
+ _XOPEN_SOURCE || _POSIX_SOURCE
#include <stdlib.h>
#include <string.h>
diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c
index 9736fed..ff5d2d1 100755
--- a/lib/ipmi_dcmi.c
+++ b/lib/ipmi_dcmi.c
@@ -36,6 +36,7 @@
* This code conforms to the 1.0 DCMI Specification
* released by Hari Ramachandran of the Intel Corporation
*/
+#define _BSD_SOURCE
#include <stdlib.h>
#include <string.h>
diff --git a/lib/ipmi_event.c b/lib/ipmi_event.c
index 2f1032e..16fc80d 100644
--- a/lib/ipmi_event.c
+++ b/lib/ipmi_event.c
@@ -29,6 +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 _BSD_SOURCE
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/ipmi_hpmfwupg.c b/lib/ipmi_hpmfwupg.c
index 8af948f..ebf4adf 100644
--- a/lib/ipmi_hpmfwupg.c
+++ b/lib/ipmi_hpmfwupg.c
@@ -30,6 +30,10 @@
* 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 _BSD_SOURCE || \
+ (_XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
+ !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/ipmi_mc.h>
@@ -38,9 +42,11 @@
#include <ipmitool/ipmi_strings.h>
#include <ipmitool/log.h>
#include "../src/plugins/lan/md5.h"
+#include <ctype.h>
#include <stdio.h>
#include <time.h>
#include <sys/param.h>
+#include <unistd.h>
#if HAVE_CONFIG_H
# include <config.h>
diff --git a/lib/ipmi_isol.c b/lib/ipmi_isol.c
index 84d7db8..bc0b08b 100644
--- a/lib/ipmi_isol.c
+++ b/lib/ipmi_isol.c
@@ -29,6 +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
#include <stdlib.h>
#include <string.h>
diff --git a/lib/ipmi_main.c b/lib/ipmi_main.c
index a752b59..e8d2562 100644
--- a/lib/ipmi_main.c
+++ b/lib/ipmi_main.c
@@ -30,6 +30,10 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#define _XOPEN_SOURCE 700
+#define _BSD_SOURCE || \
+ (_XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
+ !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/ipmi_sdr.c b/lib/ipmi_sdr.c
index 292a7d3..3bebbb7 100644
--- a/lib/ipmi_sdr.c
+++ b/lib/ipmi_sdr.c
@@ -32,6 +32,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 _BSD_SOURCE
#include <string.h>
diff --git a/lib/ipmi_sdradd.c b/lib/ipmi_sdradd.c
index f5bf78a..52848a3 100644
--- a/lib/ipmi_sdradd.c
+++ b/lib/ipmi_sdradd.c
@@ -38,6 +38,7 @@
#include <stdio.h>
#include <time.h>
#include <fcntl.h>
+#include <unistd.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
index a3c7055..396bc8a 100644
--- a/lib/ipmi_sel.c
+++ b/lib/ipmi_sel.c
@@ -29,6 +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 _BSD_SOURCE
#include <string.h>
#include <math.h>
diff --git a/lib/ipmi_sol.c b/lib/ipmi_sol.c
index 5415ea7..6c24aa8 100644
--- a/lib/ipmi_sol.c
+++ b/lib/ipmi_sol.c
@@ -29,6 +29,11 @@
* 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
+#define _BSD_SOURCE || \
+ (_XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
+ !(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
#include <stdlib.h>
#include <string.h>
diff --git a/lib/ipmi_sunoem.c b/lib/ipmi_sunoem.c
index 8a786f2..9f06136 100644
--- a/lib/ipmi_sunoem.c
+++ b/lib/ipmi_sunoem.c
@@ -29,6 +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
#include <stdlib.h>
#include <stdio.h>
diff --git a/lib/ipmi_user.c b/lib/ipmi_user.c
index e339c2a..2780e61 100644
--- a/lib/ipmi_user.c
+++ b/lib/ipmi_user.c
@@ -29,6 +29,10 @@
* 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 _BSD_SOURCE || \
+ (_XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
+ !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
#include <stdlib.h>
#include <string.h>
diff --git a/lib/log.c b/lib/log.c
index bc80542..c917d2d 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -29,6 +29,9 @@
* 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 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
+ /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
#include <unistd.h>
#include <stdio.h>
diff --git a/src/ipmievd.c b/src/ipmievd.c
index cc1ca0f..971d28b 100644
--- a/src/ipmievd.c
+++ b/src/ipmievd.c
@@ -30,6 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#define _XOPEN_SOURCE 700
+#define _BSD_SOURCE
#include <stdio.h>
#include <fcntl.h>
diff --git a/src/ipmishell.c b/src/ipmishell.c
index 6cfcbe8..205cbf9 100644
--- a/src/ipmishell.c
+++ b/src/ipmishell.c
@@ -29,6 +29,9 @@
* 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 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || \
+ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
+ /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
#include <stdio.h>
#include <unistd.h>
-----------------------------------------------------------------------
Summary of changes:
lib/helper.c | 5 ++++
lib/ipmi_chassis.c | 2 +
lib/ipmi_dcmi.c | 1 +
lib/ipmi_event.c | 1 +
lib/ipmi_hpmfwupg.c | 6 +++++
lib/ipmi_isol.c | 1 +
lib/ipmi_main.c | 4 +++
lib/ipmi_picmg.c | 54 +++++++++++++++++++++++++++-----------------------
lib/ipmi_sdr.c | 1 +
lib/ipmi_sdradd.c | 1 +
lib/ipmi_sel.c | 1 +
lib/ipmi_sol.c | 5 ++++
lib/ipmi_sunoem.c | 1 +
lib/ipmi_user.c | 4 +++
lib/log.c | 3 ++
src/ipmievd.c | 1 +
src/ipmishell.c | 3 ++
17 files changed, 69 insertions(+), 25 deletions(-)
hooks/post-receive
--
ipmitool
|