err(EXIT_FAILURE, _("failed to add output data"));
return true;
case COL_FD:
- if (file->association < 0)
+ if (!is_opened_file(file))
return false;
/* FALL THROUGH */
case COL_ASSOC:
- if (file->association >= 0)
+ if (is_opened_file(file))
xasprintf(&str, "%d", file->association);
else {
int assoc = file->association * -1;
xasprintf(&str, "%u", proc->kthread);
break;
case COL_MNT_ID:
- xasprintf(&str, "%d", file->association < 0? 0: file->mnt_id);
+ xasprintf(&str, "%d", is_opened_file(file)? file->mnt_id: 0);
break;
case COL_MODE:
if (does_file_has_fdinfo_alike(file))
case COL_FLAGS: {
struct ul_buffer buf = UL_INIT_BUFFER;
- if (file->association < 0)
+ if (!is_opened_file(file))
return true;
if (file->sys_flags == 0)
assert(file->proc);
- if (fd >= 0)
+ if (is_opened_file(file))
sprintf(path, "/proc/%d/fd/%d", file->proc->pid, fd);
else
sprintf(path, "/proc/%d/map_files/%"PRIx64 "-%" PRIx64,