From: Ian Jackson Subject: Re: [PATCH 05/20] libxl: provide libxl__remove_file et al. Date: Mon, 16 Apr 2012 11:33:17 +0100 Message-ID: <20363.62829.891721.733072@mariner.uk.xensource.com> References: <1334342414-10289-1-git-send-email-ian.jackson@eu.citrix.com> <1334342414-10289-6-git-send-email-ian.jackson@eu.citrix.com> <1334568245.14560.57.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1334568245.14560.57.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH 05/20] libxl: provide libxl__remove_file et al."): > > + size_t need = offsetof(struct dirent, d_name) + > > + pathconf(dirpath, _PC_NAME_MAX) + 1; > > This was an interesting pattern, but I see that readdir(3) recommends > portable programs do things this way... Bizarre, eh ? > > + const char *subpath = GCSPRINTF("%s/%s", dirpath, de->d_name); > > + if (libxl__remove_file_or_directory(gc, subpath)) > > + rc = ERROR_FAIL; > > Deliberately doesn't "goto out" so as to remove as much as possible? Yes. > If so then: > > Acked-by: Ian Campbell Thanks, Ian.