Eric Blake
2018-08-29 14:03:07 UTC
Detected by dcb:
dutil_posix.c:225]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
Without the patch, waitret can only ever be 0 or 1, which renders
the next line's check for -1 dead code.
Signed-off-by: Eric Blake <***@redhat.com>
---
src/dutil_posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dutil_posix.c b/src/dutil_posix.c
index 1313514..11ccff6 100644
--- a/src/dutil_posix.c
+++ b/src/dutil_posix.c
@@ -220,7 +220,7 @@ int run_program(struct netcf *ncf, const char *const *argv, char **output)
fclose(outfile);
outfile = NULL;
- while ((waitret = waitpid(childpid, &exitstatus, 0) == -1) &&
+ while (((waitret = waitpid(childpid, &exitstatus, 0)) == -1) &&
errno == EINTR) {
/* empty loop */
}
--
2.17.1
_______________________________________________
netcf-devel mailing list -- netcf-***@lists.fedorahosted.org
To unsubscribe send an email to netcf-devel-***@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/net
dutil_posix.c:225]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
Without the patch, waitret can only ever be 0 or 1, which renders
the next line's check for -1 dead code.
Signed-off-by: Eric Blake <***@redhat.com>
---
src/dutil_posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dutil_posix.c b/src/dutil_posix.c
index 1313514..11ccff6 100644
--- a/src/dutil_posix.c
+++ b/src/dutil_posix.c
@@ -220,7 +220,7 @@ int run_program(struct netcf *ncf, const char *const *argv, char **output)
fclose(outfile);
outfile = NULL;
- while ((waitret = waitpid(childpid, &exitstatus, 0) == -1) &&
+ while (((waitret = waitpid(childpid, &exitstatus, 0)) == -1) &&
errno == EINTR) {
/* empty loop */
}
--
2.17.1
_______________________________________________
netcf-devel mailing list -- netcf-***@lists.fedorahosted.org
To unsubscribe send an email to netcf-devel-***@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/net