[libvirt] [PATCH] When checking nttyFDs to see if it is != 1, be sure to use '1' and not '-1'

Eric Blake eblake at redhat.com
Thu Dec 8 15:26:41 UTC 2011


On 12/08/2011 08:00 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> * src/lxc/lxc_controller.c: Fix check for tty count
> ---
>  src/lxc/lxc_controller.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
> index 43414ba..bb936ee 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);

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111208/7419425f/attachment-0001.sig>


More information about the libvir-list mailing list