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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

* 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);
             goto cleanup;
         }
     }
-- 
1.7.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]