From 938255db08ff910109dd372adc8fb1cf406162e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 21 Nov 2018 20:53:43 -0500 Subject: [PATCH] Fix: rotation_unavailable returned on failure to read time MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A "rotation feature unavailable" error code is returned if the session daemon fails to sample time. The TIME(2) man page has makes no mention of an error that could happen in this use case (as time()'s parameter is NULL, EFAULT does not apply). However, a more general error code is more appropriate should this call fail. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index def3e64e5..1ac133f36 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4602,7 +4602,7 @@ int cmd_rotate_session(struct ltt_session *session, now = time(NULL); if (now == (time_t) -1) { - cmd_ret = LTTNG_ERR_ROTATION_NOT_AVAILABLE; + cmd_ret = LTTNG_ERR_UNK; goto end; } -- 2.34.1