trace-cmd: record: Fix glob() return value checks
glob() is defined to return zero on success or various GLOB_*
error constants, but those are not defined to be negative. In
fact, glibc makes them positive, and as a result the checks
don't do anything at all on glibc, but erroneously abort on
other libc implementations (such as bionic) that use negative
values for GLOB_* errors.
Fix this to compare against 0 only, adding documentation as
to which error result codes are possible.
Link: https://lore.kernel.org/20250703115450.14313-3-johannes@sipsolutions.net
Fixes: 6f1c80b937ee ("trace-cmd: Use glob() library call to enable events")
Fixes: 65b7fed7c15c ("trace-cmd: Add filtering of events")
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed