From patchwork Mon May 20 21:43:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 2595001 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5E84F3FD4E for ; Mon, 20 May 2013 21:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758375Ab3ETVne (ORCPT ); Mon, 20 May 2013 17:43:34 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:58630 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757234Ab3ETVnd (ORCPT ); Mon, 20 May 2013 17:43:33 -0400 Received: from dworkin.quest-ce.net (unknown [IPv6:2a01:e35:2e9f:6ac0:224:1dff:fe13:dbb2]) by smtp1-g21.free.fr (Postfix) with ESMTP id 2005D940002; Mon, 20 May 2013 23:43:24 +0200 (CEST) Received: from dworkin.quest-ce.net (localhost [127.0.0.1]) by dworkin.quest-ce.net (8.14.5/8.14.5) with ESMTP id r4KLhN0o009692; Mon, 20 May 2013 23:43:23 +0200 Received: (from ydroneaud@localhost) by dworkin.quest-ce.net (8.14.5/8.14.5/Submit) id r4KLhN1I009691; Mon, 20 May 2013 23:43:23 +0200 From: Yann Droneaud To: linux-rdma@vger.kernel.org Cc: Yann Droneaud Subject: [PATCH 1/3] read_config: ignore files beginning with '.' Date: Mon, 20 May 2013 23:43:03 +0200 Message-Id: <669b29839e890998b68f85355f2feb8943c90c6e.1369085762.git.ydroneaud@opteya.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Files beginning with a dot are mostly current and parent directories or, by convention, hidden files. Those path are skipped in find_sysfs_dev(). Signed-off-by: Yann Droneaud --- src/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/init.c b/src/init.c index 96ecf04..c880b68 100644 --- a/src/init.c +++ b/src/init.c @@ -308,6 +308,9 @@ static void read_config(void) while ((dent = readdir(conf_dir))) { struct stat buf; + if (dent->d_name[0] == '.') + continue; + if (asprintf(&path, "%s/%s", IBV_CONFIG_DIR, dent->d_name) < 0) { fprintf(stderr, PFX "Warning: couldn't read config file %s/%s.\n", IBV_CONFIG_DIR, dent->d_name);