summaryrefslogtreecommitdiff
path: root/usr/iscsi_util.c
diff options
context:
space:
mode:
authorJim Ramsay <jim_ramsay@dell.com>2011-07-20 09:06:46 -0400
committerMike Christie <michaelc@cs.wisc.edu>2011-08-02 00:04:23 -0500
commit1e3d6226e928c0ea2c857de9ab821b550ef0e18b (patch)
tree86b470df355c63673f4479d5b2a0918af938bbec /usr/iscsi_util.c
parent4c93bba5ea9610fce9999ff7dc21f28b90e947d8 (diff)
downloadopen-iscsi-1e3d6226e928c0ea2c857de9ab821b550ef0e18b.tar.gz
iscsi tools: Fix warnings reported by gcc-4.5.2
A majority of these have to deal with ignored return values. Some of the others are just unused variables or functions. One warning remains at link-time for iscsistart: iscsi_util.c:267: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking. Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
Diffstat (limited to 'usr/iscsi_util.c')
-rw-r--r--usr/iscsi_util.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
index 293ec54..270e585 100644
--- a/usr/iscsi_util.c
+++ b/usr/iscsi_util.c
@@ -48,7 +48,8 @@ void daemon_init(void)
dup2(fd, 1);
dup2(fd, 2);
setsid();
- chdir("/");
+ if (chdir("/") < 0)
+ log_debug(1, "Could not chdir to /: %s", strerror(errno));
}
#define ISCSI_OOM_PATH_LEN 48
@@ -59,7 +60,9 @@ int oom_adjust(void)
char path[ISCSI_OOM_PATH_LEN];
struct stat statb;
- nice(-10);
+ if (nice(-10) < 0)
+ log_debug(1, "Could not increase process priority: %s",
+ strerror(errno));
snprintf(path, ISCSI_OOM_PATH_LEN, "/proc/%d/oom_score_adj", getpid());
if (stat(path, &statb)) {
@@ -70,8 +73,12 @@ int oom_adjust(void)
fd = open(path, O_WRONLY);
if (fd < 0)
return -1;
- write(fd, "-16", 3); /* for 2.6.11 */
- write(fd, "-17", 3); /* for Andrea's patch */
+ if (write(fd, "-16", 3) < 0) /* for 2.6.11 */
+ log_debug(1, "Could not set oom score to -16: %s",
+ strerror(errno));
+ if (write(fd, "-17", 3) < 0) /* for Andrea's patch */
+ log_debug(1, "Could not set oom score to -17: %s",
+ strerror(errno));
close(fd);
return 0;
}