From: Daniel P. Berrange Date: Thu, 8 Dec 2011 14:57:13 +0000 (+0000) Subject: When checking nttyFDs to see if it is != 1, be sure to use '1' and not '-1' X-Git-Tag: v0.9.9-rc1~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d82fa688ee4a1d30013e8b3be0151f2c4deace1;p=thirdparty%2Flibvirt.git When checking nttyFDs to see if it is != 1, be sure to use '1' and not '-1' * src/lxc/lxc_controller.c: Fix check for tty count --- diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 43414ba40b..bb936eeaa3 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -1388,9 +1388,9 @@ lxcControllerRun(virDomainDefPtr def, VIR_FREE(devptmx); } } else { - if (nttyFDs != -1) { - lxcError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Expected exactly one TTY fd")); + if (nttyFDs != 1) { + lxcError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Expected exactly one TTY fd, but got %zu"), nttyFDs); goto cleanup; } }