commands: return -1 on lxc_cmd_get_init_pid() err

A while back the whole lxc_cmd() infrastructure was changed to return
meaningful negative error codes. But lxc_cmd_get_init_pid() should always
return -1. Make it so!

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-08-25 06:17:49 +02:00
parent 7ee4b4b8f0
commit 8ed8a6265b
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -381,7 +381,7 @@ pid_t lxc_cmd_get_init_pid(const char *name, const char *lxcpath)
ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL);
if (ret < 0)
return ret;
return -1;
return PTR_TO_INT(cmd.rsp.data);
}