From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: Re: [PATCH v2] xenconsole: Ensure exclusive access to console using locks Date: Fri, 24 Jul 2015 16:07:14 +0100 Message-ID: <21938.21666.285588.16673@mariner.uk.xensource.com> References: <20150724134222.GF25338@nodbug.lucina.net> <1437749222-29918-1-git-send-email-martin@lucina.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZIeZl-0005CI-67 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2015 15:07:53 +0000 In-Reply-To: <1437749222-29918-1-git-send-email-martin@lucina.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Martin Lucina Cc: xen-devel@lists.xenproject.org, Wei Liu , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Martin Lucina writes ("[PATCH v2] xenconsole: Ensure exclusive access to console using locks"): > If more than one instance of xenconsole is run against the same DOMID > then each instance will only get some data. This change ensures > exclusive access to the console by obtaining an exclusive lock on > /xenconsole.. ... > +static void console_unlock(void) > +{ > + if (lockfile[0]) > + unlink(lockfile); > + if (lockfd != -1) > + close(lockfd); > +} If called when unlocked this could unlink the lockfile anyway. Ian.