diff options
author | Alexander Kapshuk <alexander.kapshuk@gmail.com> | 2018-05-12 12:02:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-14 17:36:39 +0300 |
commit | 1c9a4be514e7a946f7811f10d6d0ebab1ec6dd56 (patch) | |
tree | ab1c1efd3a31b5fa6288b18990cfa49d412f4300 /drivers/hv | |
parent | 4169bc43dbdd6c08436a7d794844b1f09a6367ae (diff) | |
download | linux-1c9a4be514e7a946f7811f10d6d0ebab1ec6dd56.tar.xz |
ver_linux: Drop redundant calls to system() to test if file is readable
Running 'test -r' on an awk variable name whose value is an empty
string results in test being run with no arguments, and causes system()
to return 0, which indicates success when used to test values returned
by function calls. This results in code within the if blocks being run
when it should not be.
Instead of testing if a file is accessible and readable via calls to
system("test -r " file), rely on the value returned by getline to perform
this kind of testing. Getline returns -1 on error, with the code within
the while loops not being run.
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
0 files changed, 0 insertions, 0 deletions