From: Jérémie Galarneau Date: Thu, 22 Nov 2018 01:53:43 +0000 (-0500) Subject: Fix: rotation_unavailable returned on failure to read time X-Git-Tag: v2.11.0-rc2~147 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=420fd242c2ff0b1d6402c509aca35ffc15430e54;p=lttng-tools.git Fix: rotation_unavailable returned on failure to read time 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 --- 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; }