From: Daniel Lezcano Date: Thu, 8 Apr 2010 07:44:23 +0000 (+0200) Subject: Fail gracefully with attach X-Git-Tag: lxc-0.7.0~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=305bc646f5a579fb258a66dd34f4d9488d0d08fe;p=thirdparty%2Flxc.git Fail gracefully with attach Fail when we try to attach to an non existing container Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/lxc_attach.c b/src/lxc/lxc_attach.c index 13e1518f2..13b89ff51 100644 --- a/src/lxc/lxc_attach.c +++ b/src/lxc/lxc_attach.c @@ -65,8 +65,8 @@ pid_t get_init_pid(const char *name) ret = lxc_command(name, &command, &stopped); if (ret < 0 && stopped) { - INFO("'%s' is already stopped", name); - return 0; + ERROR("'%s' is not running", name); + return -1; } if (ret < 0) {