summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-25 16:45:06 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-05-03 11:46:17 -0400
commit3353308213d623b2ad0f0044859039c0f8cb7ef5 (patch)
tree3154120a00af7f49e640387bfc6dbb39ede2964f /src/tools
parentf69456de37d7a4bf9ffd527c747a3ccb14fc0635 (diff)
downloadsssd-3353308213d623b2ad0f0044859039c0f8cb7ef5.tar.gz
sssd-3353308213d623b2ad0f0044859039c0f8cb7ef5.tar.xz
sssd-3353308213d623b2ad0f0044859039c0f8cb7ef5.zip
SSS_DEBUGLEVEL: silence analyzer warnings
Errno was returned instead of ret. The other hunk removes return code from fread - it is not needed, the NULL termination of the string is ensured by initializing the buffer.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/sss_debuglevel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/sss_debuglevel.c b/src/tools/sss_debuglevel.c
index 83be14442..603ae1669 100644
--- a/src/tools/sss_debuglevel.c
+++ b/src/tools/sss_debuglevel.c
@@ -218,7 +218,7 @@ errno_t send_sighup()
ret = errno;
DEBUG(SSSDBG_CRIT_FAILURE, ("Could not send SIGHUP to process %d: %s\n",
pid, strerror(errno)));
- return errno;
+ return ret;
}
return EOK;
@@ -333,7 +333,7 @@ errno_t get_sssd_pid(pid_t *out_pid)
goto done;
}
- ret = fread(pid_str, sizeof(char), MAX_PID_LENGTH * sizeof(char), pid_file);
+ fread(pid_str, sizeof(char), MAX_PID_LENGTH * sizeof(char), pid_file);
if (!feof(pid_file)) {
/* eof not reached */
ret = ferror(pid_file);
@@ -347,6 +347,7 @@ errno_t get_sssd_pid(pid_t *out_pid)
goto done;
}
+ pid_str[MAX_PID_LENGTH-1] = '\0';
*out_pid = parse_pid(pid_str);
if (*out_pid == 0) {
DEBUG(SSSDBG_CRIT_FAILURE,