Fix: report to client when snapshot will be empty
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 4343fb114191352dbdaf13ee7a928fc283119c08..dd9e6927e32d1f9ff1c831d55aee7e774f9b667c 100644 (file)
@@ -2846,12 +2846,17 @@ static int record_ust_snapshot(struct ltt_ust_session *usess,
 
        ret = ust_app_snapshot_record(usess, output, wait, nb_streams);
        if (ret < 0) {
-               if (ret == -EINVAL) {
+               switch (-ret) {
+               case EINVAL:
                        ret = LTTNG_ERR_INVALID;
-                       goto error_snapshot;
+                       break;
+               case ENODATA:
+                       ret = LTTNG_ERR_SNAPSHOT_NODATA;
+                       break;
+               default:
+                       ret = LTTNG_ERR_SNAPSHOT_FAIL;
+                       break;
                }
-
-               ret = LTTNG_ERR_SNAPSHOT_FAIL;
                goto error_snapshot;
        }
 
This page took 0.02331 seconds and 4 git commands to generate.