From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7D25F1F462 for ; Tue, 21 May 2019 13:15:27 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=GmLSW9AphPYRnYNXeslrWNgccm+AIlmwzRObDmyc3vB D7z2QgF7wFxr9/C6VRaMDfqPGyUWGYa7yJKWgoUJfWjGnra45WkzTnycOjvRhbdO tKgn7/8pPCRAjsTaKwYiK33KAP4Nb1i0XOu61YJGMLorKBALn1DEvrUN2RS4wULw = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=3Em69V6S+YQ8I1ez2ffwiFItrIE=; b=xmnHXvPOV4CX4FTZ5 F/LEsHNJ1ltD2v4YQ5Fi4SOEdk/xelSHhu4/cMJ52IZBWwPi6WE0U4OxoO3S9K/Q sSCegFx+h/5y6ETPInefFVtUctQEs1UH0bjLkdiz06hCpF1wSE4lWtb3TeQYIlWa nkAnwV8zackPIZjn5cHR4ZAd8o= Received: (qmail 22521 invoked by alias); 21 May 2019 13:15:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 22462 invoked by uid 89); 21 May 2019 13:15:23 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Alexandra =?utf-8?B?SMOhamtvdsOh?= Cc: libc-alpha@sourceware.org, mcermak@redhat.com, Alexandra =?utf-8?B?SMOhamtvdsOh?= Subject: Re: [PATCH v5] elf: Add tst-ldconfig-bad-aux-cache test [BZ #18093] References: <20190516214903.11884-1-ahajkova@redhat.com> Date: Tue, 21 May 2019 15:15:18 +0200 In-Reply-To: <20190516214903.11884-1-ahajkova@redhat.com> ("Alexandra \=\?utf-8\?B\?SMOhamtvdsOhIidz\?\= message of "Thu, 16 May 2019 23:49:03 +0200") Message-ID: <87a7fg9cex.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable * Alexandra H=C3=A1jkov=C3=A1: > +static int > +display_info (const char *fpath, const struct stat *sb, > + int tflag, struct FTW *ftwbuf) > +{ > + printf ("%-3s %2d %7jd %-40s %d %s\n", > + (tflag =3D=3D FTW_D) ? "d" : (tflag =3D=3D FTW_DNR) ? "dnr" : > + (tflag =3D=3D FTW_DP) ? "dp" : (tflag =3D=3D FTW_F) ? "f" : > + (tflag =3D=3D FTW_NS) ? "ns" : (tflag =3D=3D FTW_SL) ? "sl" : > + (tflag =3D=3D FTW_SLN) ? "sln" : "???", > + ftwbuf->level, (intmax_t) sb->st_size, > + fpath, ftwbuf->base, fpath + ftwbuf->base); > + /* To tell nftw to continue. */ > + return 0; > +} Maybe add an info: prefix to the line, to indicate that this output does not reflect an error condition? > + xwaitpid (pid, &status, 0); > + if (!(WIFEXITED (status))) > + FAIL_EXIT1 ("ldconfig was aborted"); > + xstat (path, &fs); > + xwaitpid (pid, &status, 0); > + if (!(WIFEXITED (status))) > + FAIL_EXIT1 ("ldconfig exited with non-zero status"); I think we really expect exit status 0 in this case, so you could use TEST_COMPARE (status, 0) in both cases. > + if (truncate (path, new_size)) > + { > + FAIL_EXIT1 ("truncation failed: %m"); > + } > + if (nftw (path, display_info, 1000, 0) =3D=3D -1) > + { > + FAIL_EXIT1 ("nftw failed."); > + } Here the braces are unnecessary. Sorry for the piece-by-piece review, but we are definitely getting close! Thanks, Florian