Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp515815rdb; Tue, 5 Dec 2023 11:29:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP/QJFzJnlypwLcs1H8b404WiAsPiexxegUTIVR7uUFaMU83/+aKbLnlAoQyWNzedXhlUj X-Received: by 2002:a62:6187:0:b0:6be:130a:22a0 with SMTP id v129-20020a626187000000b006be130a22a0mr1781456pfb.14.1701804576731; Tue, 05 Dec 2023 11:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701804576; cv=none; d=google.com; s=arc-20160816; b=bAPgX+YkoJJTTCckKgxayCUIMO+qpLqSm9GHIiVOdITNNZKoEbdDYtE3g21Lx5pcmM G1GbJ1SolAsEWuBAyoK9KuGXWTY5HjTg7/YsNjYFj8vwZIkf9niFgwmz0TV8xbAcSdgN 7vO6zWazJPvft4nG5AbTTnRwOCPNWXOwwdIeIwj0ZQPkqTBICar4aRzkNpVH33DuIZPI DPvYlgwHUyX0suMwS/t2Cv7OZ3yp71o73OJ0tg42FEfhZfAJ2c5DlVRfcxUmiFQdxSwW Jk68QT1KyVsJN1n6Eopdv/aHgCbt6xF/uDXiw/uLASNjmlKZ1Kvvp6GM6G77ANyfRXtA YXmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=2eq2DMq1WO4X/Xd7+NI5PjO+TbnA8mrc7ic+TXsok6c=; fh=X+EyhGLOnc20nszN9yx9kykhker0HdXxUgxJEqbBcDI=; b=wNrQYj1hdE+M8993uJ9hdfvQ1DeJfWiKqvU4FSpaJRfDW6MddYOrNK5ymCmcEcQhpU yqaml7Avo9ehWr5jjM2W7df7a9wbVttttHC/UVPawanAmsfpE7YNJK62sNVVwdNInNpZ ijVyLp3Qvot45I43dLxH1vnTQMlHR2rcCTjxdj4GZszALk0/qE5dSxH91NtyD/p+7eFP seQiBT/UKbB/e3CebHON7XhepcIeOO0v+0nGiB3uwxkGphczBshUqBxDxBGVaBe/7XYm WdFFSKYAHgBX/AGS7sPlShdIb2ynF3UqSdjBm0NiAutHfiBCkjA9ffuzD2imQ8FtBCoQ HJyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X7sY13Z1; spf=pass (google.com: domain of linux-nfs+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j27-20020a63595b000000b005c6582f7984si6138450pgm.749.2023.12.05.11.29.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 11:29:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X7sY13Z1; spf=pass (google.com: domain of linux-nfs+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9EC66B21030 for ; Tue, 5 Dec 2023 19:29:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA4746D1DE; Tue, 5 Dec 2023 19:29:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X7sY13Z1" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88B4FAB for ; Tue, 5 Dec 2023 11:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701804567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=2eq2DMq1WO4X/Xd7+NI5PjO+TbnA8mrc7ic+TXsok6c=; b=X7sY13Z1jJD6HvD4JTMxYSBPQwL24pCw44IMOKkpXTfk5xJQJNIWAa3CpWDuLE+rytuYv0 eLKuAFn2xGS7PO9qcWPHuIOzqHuJdC17RIbJyM6T+ZkZSX1vXqcZQC8wkaAm5xHPBjL2uz LMyuiBhwV6RW8IDE8mF6JDF9/3mnRx0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-73-HF3KbUiRNSOz1lJTjwlbPg-1; Tue, 05 Dec 2023 14:29:25 -0500 X-MC-Unique: HF3KbUiRNSOz1lJTjwlbPg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A63E2890FC2 for ; Tue, 5 Dec 2023 19:29:25 +0000 (UTC) Received: from bighat.boston.devel.redhat.com (bighat.boston.devel.redhat.com [10.19.60.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9375F2166B35 for ; Tue, 5 Dec 2023 19:29:25 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] conf_init_file: Fixed warn_unused_result error Date: Tue, 5 Dec 2023 14:29:24 -0500 Message-ID: <20231205192924.99320-1-steved@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 conffile.c: In function 'conf_init_file': conffile.c:776:17: error: ignoring return value of 'asprintf' declared with attribute 'warn_unused_result' [-Werror=unused-result] 776 | asprintf(&usrconf, "/usr%s", conf_file); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Steve Dickson --- support/nfs/conffile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c index 884eca9..1e9c22b 100644 --- a/support/nfs/conffile.c +++ b/support/nfs/conffile.c @@ -754,6 +754,7 @@ void conf_init_file(const char *conf_file) { unsigned int i; + int j; for (i = 0; i < sizeof conf_bindings / sizeof conf_bindings[0]; i++) LIST_INIT (&conf_bindings[i]); @@ -773,8 +774,8 @@ conf_init_file(const char *conf_file) if (strncmp(conf_file, "/etc/", 5) == 0) { char *usrconf = NULL; - asprintf(&usrconf, "/usr%s", conf_file); - if (usrconf) { + j = asprintf(&usrconf, "/usr%s", conf_file); + if (usrconf && j > 0) { conf_load_file(usrconf); conf_init_dir(usrconf); free(usrconf); -- 2.41.0