mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
os: Fix open result check.
Fix defect reported by Coverity Scan. Argument cannot be negative (NEGATIVE_RETURNS) negative_returns: f is passed to a parameter that cannot be negative. CID: 1364709 Fixes:13fa051356("auxiliary/os: add new os_get_command_line() function") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7344> (cherry picked from commitb2a21febe0)
This commit is contained in:
parent
9f3d7d54d8
commit
8f766d37eb
2 changed files with 2 additions and 2 deletions
|
|
@ -5539,7 +5539,7 @@
|
|||
"description": "os: Fix open result check.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "13fa0513569d0145487e12f3bc3aa10bc51088f7"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ os_get_command_line(char *cmdline, size_t size)
|
|||
}
|
||||
#elif defined(PIPE_OS_LINUX)
|
||||
int f = open("/proc/self/cmdline", O_RDONLY);
|
||||
if (f) {
|
||||
if (f != -1) {
|
||||
const int n = read(f, cmdline, size - 1);
|
||||
int i;
|
||||
assert(n < size);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue