diff options
author | Lee Duncan <lduncan@suse.com> | 2020-01-29 10:11:36 -0800 |
---|---|---|
committer | Lee Duncan <lduncan@suse.com> | 2020-01-29 10:11:36 -0800 |
commit | 6827b8dd191e1e94402871dba9cde9ecb076143a (patch) | |
tree | cea07f9485bb0d083a99b72c3b403a4f987d1fdf /iscsiuio | |
parent | 499a006a7d6bb154f9e1ab430e4c9e231ba6096a (diff) | |
download | open-iscsi-6827b8dd191e1e94402871dba9cde9ecb076143a.tar.gz |
Fix 586 compiler issues.
Now that "-Werror" is turned on, 32-bit x86 compile problems are
fatal, so fix them.
*Should* be no functional change.
Diffstat (limited to 'iscsiuio')
-rw-r--r-- | iscsiuio/src/unix/main.c | 21 | ||||
-rw-r--r-- | iscsiuio/src/unix/nic_utils.c | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c index 5e3f66c..0c9ad49 100644 --- a/iscsiuio/src/unix/main.c +++ b/iscsiuio/src/unix/main.c @@ -51,6 +51,7 @@ #ifndef NO_SYSTEMD #include <systemd/sd-daemon.h> #endif +#include <assert.h> #include "uip.h" #include "uip_arp.h" @@ -186,16 +187,17 @@ static void main_usage() static void daemon_init() { int fd; + int res; fd = open("/dev/null", O_RDWR); - if (fd == -1) - exit(-1); + assert(fd >= 0); dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); setsid(); - chdir("/"); + res = chdir("/"); + assert(res == 0); close(fd); } @@ -338,10 +340,12 @@ int main(int argc, char *argv[]) exit(1); } else if (pid) { char msgbuf[4]; + int res; /* parent: wait for child msg then exit */ - close(pipefds[1]); - read(pipefds[0], msgbuf, sizeof(msgbuf)); + close(pipefds[1]); /* close unused end */ + res = read(pipefds[0], msgbuf, sizeof(msgbuf)); + assert(res > 0); exit(0); } @@ -414,9 +418,12 @@ int main(int argc, char *argv[]) goto error; if (!foreground) { + int res; + /* signal parent they can go away now */ - close(pipefds[0]); - write(pipefds[1], "ok\n", 3); + close(pipefds[0]); /* close unused end */ + res = write(pipefds[1], "ok\n", 3); + assert(res > 0); close(pipefds[1]); } diff --git a/iscsiuio/src/unix/nic_utils.c b/iscsiuio/src/unix/nic_utils.c index 84ffc5c..ec3b915 100644 --- a/iscsiuio/src/unix/nic_utils.c +++ b/iscsiuio/src/unix/nic_utils.c @@ -1252,7 +1252,7 @@ int get_iscsi_transport_handle(nic_t *nic, uint64_t *handle) if (rc != 0) goto error; - elements_read = sscanf(raw, "%lu", handle); + elements_read = sscanf(raw, "%" PRIu64, handle); if (elements_read != 1) { LOG_ERR(PFX "%s: Couldn't parse transport handle from %s", nic->log_name, temp_path); |