From aee1ab350700f0d1a9781bf415bea3081cd48d47 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 11 Jan 2011 13:50:30 -0200 Subject: [PATCH 42/48] vnc/spice: fix "never" and "now" expire_time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RH-Author: Gerd Hoffmann Message-id: <1294753832-1164-4-git-send-email-kraxel@redhat.com> Patchwork-id: 16113 O-Subject: [RHEL-6.1 kvm PATCH v2 3/5] vnc/spice: fix "never" and "now" expire_time Bugzilla: 615947 631832 632458 634153 642131 647865 RH-Acked-by: Uri Lublin RH-Acked-by: Alon Levy RH-Acked-by: Hans de Goede From: Marc-André Lureau upstream: submitted (http://patchwork.ozlabs.org/patch/78149/) Signed-off-by: Gerd Hoffmann --- monitor.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Signed-off-by: Luiz Capitulino --- monitor.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 775dff8..ec7347d 100644 --- a/monitor.c +++ b/monitor.c @@ -1240,9 +1240,9 @@ static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data) time_t when; int rc; - if (strcmp(whenstr, "now")) { + if (strcmp(whenstr, "now") == 0) { when = 0; - } else if (strcmp(whenstr, "never")) { + } else if (strcmp(whenstr, "never") == 0) { when = TIME_MAX; } else if (whenstr[0] == '+') { when = time(NULL) + strtoull(whenstr+1, NULL, 10); -- 1.7.4.rc1.16.gd2f15e