From: Jérémie Galarneau Date: Fri, 7 Sep 2018 01:39:18 +0000 (-0400) Subject: Fix: non-zero return of open handled as error X-Git-Tag: v2.12.0-rc1~817 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7da8e14c9d64da5a485f982d6f17b5eb4365b04f;p=lttng-tools.git Fix: non-zero return of open handled as error The open() run_as wrapper marks any non-zero return value of open() as an error, causing the transmission of the file descriptor to be skipped. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/runas.c b/src/common/runas.c index 33462958f..c81652e9f 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -218,7 +218,7 @@ int _open(struct run_as_data *data, struct run_as_ret *ret_value) ret_value->u.open.ret = open(data->u.open.path, data->u.open.flags, data->u.open.mode); ret_value->fd = ret_value->u.open.ret; ret_value->_errno = errno; - ret_value->_error = (ret_value->u.open.ret) ? true : false; + ret_value->_error = ret_value->u.open.ret < 0; return ret_value->u.open.ret; }