trace-cmd: libtrace-cmd: 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-2-johannes@sipsolutions.net
Fixes: 3de68e3ec662 ("trace-cmd: Only record the formats of the events being recorded")
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 file changed