linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] libtracefs: Fix enable_disable_all() return value
@ 2021-06-08 13:55 Yordan Karadzhov (VMware)
  2021-06-08 13:55 ` [PATCH 2/4] libtracefs: Fix event_enable_disable() " Yordan Karadzhov (VMware)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-06-08 13:55 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

enable_disable_all() is a static method used internally by the
tracefs_event_enable/disable() API. In some cases its return
value gets propagated as a return of the API function but this
value do not obey the description given in the documentation.

Fixes: fc94d1a (libtracefs: Add tracefs_event_enable/disable() API)
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/tracefs-events.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 55316c6..8b2d9ef 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -822,8 +822,10 @@ static int enable_disable_all(struct tracefs_instance *instance,
 			      bool enable)
 {
 	const char *str = enable ? "1" : "0";
+	int ret;
 
-	return tracefs_instance_file_write(instance, "events/enable", str);
+	ret = tracefs_instance_file_write(instance, "events/enable", str);
+	return ret < 0 ? ret : 0;
 }
 
 static int event_enable_disable(struct tracefs_instance *instance,
-- 
2.27.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-11 11:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 13:55 [PATCH 1/4] libtracefs: Fix enable_disable_all() return value Yordan Karadzhov (VMware)
2021-06-08 13:55 ` [PATCH 2/4] libtracefs: Fix event_enable_disable() " Yordan Karadzhov (VMware)
2021-06-08 13:55 ` [PATCH 3/4] libtracefs: Fix typo in function name Yordan Karadzhov (VMware)
2021-06-08 13:55 ` [PATCH 4/4] libtracefs: Propagate the return value of the callback function Yordan Karadzhov (VMware)
2021-06-09 17:00   ` Steven Rostedt
2021-06-11 11:03     ` Yordan Karadzhov (VMware)

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).