Fix: rotation_unavailable returned on failure to read time
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 22 Nov 2018 01:53:43 +0000 (20:53 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 10 Dec 2018 20:24:49 +0000 (15:24 -0500)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index def3e64e59a2d27899d1b70dba0f74e74a7b7dea..1ac133f3606d68d3114bb6405f103d89f30851ea 100644 (file)
@@ -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;
        }
 
This page took 0.028728 seconds and 4 git commands to generate.