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@xxxxxxxxx> --- 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