Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ int main(int argc, char *argv[]) {
/*
* Check command specifications.
*/
if (str->f)
if (str->f || str->x)
continue;
rv = LSOF_SEARCH_FAILURE;
if (Fverbose) {
Expand Down
16 changes: 14 additions & 2 deletions tests/case-20-exit-status.bash
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ f=/tmp/lsof-${name}-$$
exit 1
;;
esac
# Excluded commands are not search targets and must not cause failures.
output=$("$lsof" -a -p $$ -c '^LTNoMatch' -V -Fp)
s=$?
if [ "$s" -ne 0 ] || [ "$output" != "p$$" ]; then
echo "command exclusion: expected status 0 and p$$, got $s: $output"
exit 1
fi
# A missing inclusion must still fail even when an exclusion is present.
"$lsof" -a -p $$ -c LTNoMatch -c '^sleep' > /dev/null
s=$?
if [ "$s" -ne 1 ]; then
echo "missing command inclusion: expected status 1, got $s"
exit 1
fi
} > $report 2>&1


Loading