summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/findif.c2
-rw-r--r--tools/ocft/exportfs5
-rw-r--r--tools/ocft/exportfs-multidir5
-rw-r--r--tools/storage_mon.c12
4 files changed, 11 insertions, 13 deletions
diff --git a/tools/findif.c b/tools/findif.c
index a25395f..ab108a3 100644
--- a/tools/findif.c
+++ b/tools/findif.c
@@ -669,7 +669,7 @@ main(int argc, char ** argv) {
}
}
- if (netmaskbits) {
+ if (netmaskbits != NULL && *netmaskbits != EOS) {
best_netmask = netmask;
}else if (best_netmask == 0L) {
/*
diff --git a/tools/ocft/exportfs b/tools/ocft/exportfs
index 285a4b8..1ec3d4c 100644
--- a/tools/ocft/exportfs
+++ b/tools/ocft/exportfs
@@ -28,11 +28,6 @@ CASE "check base env"
Include prepare
AgentRun start OCF_SUCCESS
-CASE "check base env: no 'OCF_RESKEY_fsid'"
- Include prepare
- Env OCF_RESKEY_fsid=
- AgentRun start OCF_ERR_CONFIGURED
-
CASE "check base env: invalid 'OCF_RESKEY_directory'"
Include prepare
Env OCF_RESKEY_directory=/no_such
diff --git a/tools/ocft/exportfs-multidir b/tools/ocft/exportfs-multidir
index 00e41f0..ac6d5c7 100644
--- a/tools/ocft/exportfs-multidir
+++ b/tools/ocft/exportfs-multidir
@@ -28,11 +28,6 @@ CASE "check base env"
Include prepare
AgentRun start OCF_SUCCESS
-CASE "check base env: no 'OCF_RESKEY_fsid'"
- Include prepare
- Env OCF_RESKEY_fsid=
- AgentRun start OCF_ERR_CONFIGURED
-
CASE "check base env: invalid 'OCF_RESKEY_directory'"
Include prepare
Env OCF_RESKEY_directory=/no_such
diff --git a/tools/storage_mon.c b/tools/storage_mon.c
index 1aae29e..a9227ef 100644
--- a/tools/storage_mon.c
+++ b/tools/storage_mon.c
@@ -382,9 +382,11 @@ static int write_pid_file(const char *pidfile)
syslog(LOG_ERR, "Failed to write '%s' to %s: %s", pid, pidfile, strerror(errno));
goto done;
}
- close(fd);
rc = 0;
done:
+ if (fd != -1) {
+ close(fd);
+ }
if (pid != NULL) {
free(pid);
}
@@ -653,6 +655,7 @@ storage_mon_client(void)
int32_t rc;
+ memset(&response, 0, sizeof(response));
snprintf(ipcs_name, SMON_MAX_IPCSNAME, "storage_mon_%s", attrname);
conn = qb_ipcc_connect(ipcs_name, 0);
if (conn == NULL) {
@@ -663,6 +666,7 @@ storage_mon_client(void)
snprintf(request.message, SMON_MAX_MSGSIZE, "%s", SMON_GET_RESULT_COMMAND);
request.hdr.id = 0;
request.hdr.size = sizeof(struct storage_mon_check_value_req);
+ response.hdr.id = 0;
rc = qb_ipcc_send(conn, &request, request.hdr.size);
if (rc < 0) {
syslog(LOG_ERR, "qb_ipcc_send error : %d\n", rc);
@@ -683,7 +687,11 @@ storage_mon_client(void)
/* greater than 0 : monitoring error. */
/* -1 : communication system error. */
/* -2 : Not all checks completed for first device in daemon mode. */
- rc = atoi(response.message);
+ if (strnlen(response.message, 1)) {
+ rc = atoi(response.message);
+ } else {
+ rc = -1;
+ }
syslog(LOG_DEBUG, "daemon response[%d]: %s \n", response.hdr.id, response.message);