]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fail gracefully with attach
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 8 Apr 2010 07:44:23 +0000 (09:44 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 8 Apr 2010 07:44:23 +0000 (09:44 +0200)
Fail when we try to attach to an non existing container

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/lxc_attach.c

index 13e1518f2af2736c12f88c0a38ffc8d68fa88fae..13b89ff51027d09043fc4b6e14a4e3e8d1e2a11e 100644 (file)
@@ -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) {