From: Ian Jackson Subject: Re: [PATCH 6/6] libxl: vncviewer: make autopass work properly Date: Thu, 3 Feb 2011 18:40:13 +0000 Message-ID: <19786.63117.565925.259009@mariner.uk.xensource.com> References: <1296584702-20138-1-git-send-email-ian.jackson@eu.citrix.com> <1296584702-20138-2-git-send-email-ian.jackson@eu.citrix.com> <1296584702-20138-3-git-send-email-ian.jackson@eu.citrix.com> <1296584702-20138-4-git-send-email-ian.jackson@eu.citrix.com> <1296584702-20138-5-git-send-email-ian.jackson@eu.citrix.com> <1296584702-20138-6-git-send-email-ian.jackson@eu.citrix.com> <1296584702-20138-7-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 6/6] libxl: vncviewer: make autopass work properly"): > On Tue, 1 Feb 2011, Ian Jackson wrote: > > + if ( autopass_fd < 0 ) { > > + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, > > + "mkstemp %s failed", tmpname); > > + exit(-1); > > + } > > I don't think we should call exit here, this is a library not an > executable. However instead of just skipping autopass we should avoid > exec'ing vncviewer completely and return and error. The caller must already tolerate the function simply causing the process to die, because execve can fail like that. Ie, libxl_exec_vncviewer is already called only after fork. So it seemed best to have the function always fail the same way. If we had a function which merely returned the vnc connection info, I would agree with you that it shouldn't exit. We should do that in 4.2. Ian.