lsfd: check ul_strtou*() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
acc47228f0
commit
399b78ea30
1 changed files with 16 additions and 10 deletions
|
@ -352,18 +352,24 @@ static bool file_fill_column(struct proc *proc,
|
||||||
|
|
||||||
static int file_handle_fdinfo(struct file *file, const char *key, const char* value)
|
static int file_handle_fdinfo(struct file *file, const char *key, const char* value)
|
||||||
{
|
{
|
||||||
if (strcmp(key, "pos") == 0) {
|
int rc;
|
||||||
ul_strtou64(value, &file->pos, 10);
|
|
||||||
return 1;
|
if (strcmp(key, "pos") == 0) {
|
||||||
} else if (strcmp(key, "flags") == 0) {
|
rc = ul_strtou64(value, &file->pos, 10);
|
||||||
ul_strtou32(value, &file->sys_flags, 8);
|
|
||||||
|
} else if (strcmp(key, "flags") == 0) {
|
||||||
|
rc = ul_strtou32(value, &file->sys_flags, 8);
|
||||||
|
|
||||||
return 1;
|
|
||||||
} else if (strcmp(key, "mnt_id") == 0) {
|
} else if (strcmp(key, "mnt_id") == 0) {
|
||||||
ul_strtou32(value, &file->mnt_id, 10);
|
rc = ul_strtou32(value, &file->mnt_id, 10);
|
||||||
return 1;
|
|
||||||
}
|
} else
|
||||||
return 0;
|
return 0; /* ignore -- unknown item */
|
||||||
|
|
||||||
|
if (rc < 0)
|
||||||
|
return 0; /* ignore -- parse failed */
|
||||||
|
|
||||||
|
return 1; /* success */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void file_free_content(struct file *file)
|
static void file_free_content(struct file *file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue