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.12.0-rc1~734 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=938255db08ff910109dd372adc8fb1cf406162e0;hp=3cf0ebeef90a629c59333544a9fb3bd75f2dbfc6 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; }