Cleanup: more descriptive error message
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Aug 2015 11:12:51 +0000 (07:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Aug 2015 11:13:33 +0000 (07:13 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-comm/lttng-ust-comm.c

index 751ad2e3cf2add1ffd805c9ca4df802034e793b1..631ff42f0862ea027bd980b24dfbd041bc5bba8e 100644 (file)
@@ -515,19 +515,27 @@ int ustcomm_recv_app_reply(int sock, struct ustcomm_ust_reply *lur,
        case 0: /* orderly shutdown */
                return -EPIPE;
        case sizeof(*lur):
+       {
+               int err = 0;
+
                if (lur->handle != expected_handle) {
                        ERR("Unexpected result message handle: "
                                "expected: %u vs received: %u\n",
                                expected_handle, lur->handle);
-                       return -EINVAL;
+                       err = 1;
                }
                if (lur->cmd != expected_cmd) {
                        ERR("Unexpected result message command "
                                "expected: %u vs received: %u\n",
                                expected_cmd, lur->cmd);
+                       err = 1;
+               }
+               if (err) {
                        return -EINVAL;
+               } else {
+                       return lur->ret_code;
                }
-               return lur->ret_code;
+       }
        default:
                if (len >= 0) {
                        ERR("incorrect message size: %zd\n", len);
This page took 0.025682 seconds and 4 git commands to generate.