From patchwork Thu Jan 6 10:43:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 77702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 37781B6F07 for ; Thu, 6 Jan 2011 21:46:28 +1100 (EST) Received: from localhost ([127.0.0.1]:50660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PanMM-0002cT-GO for incoming@patchwork.ozlabs.org; Thu, 06 Jan 2011 05:46:22 -0500 Received: from [140.186.70.92] (port=60874 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PanJT-0001Mi-Pp for qemu-devel@nongnu.org; Thu, 06 Jan 2011 05:43:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PanJS-0003fS-Cz for qemu-devel@nongnu.org; Thu, 06 Jan 2011 05:43:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PanJS-0003ew-5c for qemu-devel@nongnu.org; Thu, 06 Jan 2011 05:43:22 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06AhKEC017272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Jan 2011 05:43:20 -0500 Received: from localhost (vpn1-4-143.ams2.redhat.com [10.36.4.143]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p06AhJd5023371; Thu, 6 Jan 2011 05:43:19 -0500 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Thu, 6 Jan 2011 11:43:17 +0100 Message-Id: <1294310597-30720-1-git-send-email-marcandre.lureau@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id p06AhKEC017272 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , kraxel@redhat.com Subject: [Qemu-devel] [PATCH] vnc/spice: fix "never" and "now" expire_time X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau --- monitor.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index f258000..038d532 100644 --- a/monitor.c +++ b/monitor.c @@ -1136,9 +1136,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);