* [PATCH] libtracefs: Return negative number when tracefs_filter_string_append() fails
@ 2022-07-22 20:17 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2022-07-22 20:17 UTC (permalink / raw)
To: Linux Trace Devel
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
If the field passed into tracefs_filter_string_append() does not match a
field of the event, or if the value is not proper, it fails to append the
filter, but still returns 0 as it was successful.
Return -1 if it fails.
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
src/tracefs-filter.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/tracefs-filter.c b/src/tracefs-filter.c
index 85d0be17f6b7..b16dfadb3aa9 100644
--- a/src/tracefs-filter.c
+++ b/src/tracefs-filter.c
@@ -423,7 +423,8 @@ int tracefs_filter_string_append(struct tep_event *event, char **filter,
free(*filter);
*filter = str;
}
- return 0;
+
+ return ret;
}
static int error_msg(char **err, char *str,
--
2.35.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-22 20:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-22 20:17 [PATCH] libtracefs: Return negative number when tracefs_filter_string_append() fails Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).