From patchwork Thu Mar 31 09:29:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Droneaud X-Patchwork-Id: 678741 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2V9bjmG009809 for ; Thu, 31 Mar 2011 09:37:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933634Ab1CaJhj (ORCPT ); Thu, 31 Mar 2011 05:37:39 -0400 Received: from smtp04.smtpout.orange.fr ([80.12.242.126]:21629 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933625Ab1CaJhg (ORCPT ); Thu, 31 Mar 2011 05:37:36 -0400 Received: from deela.quest-ce.net ([80.12.82.111]) by mwinf5d03 with ME id RlVd1g0022Q6X8003lVdx7; Thu, 31 Mar 2011 11:29:37 +0200 Received: from deela.quest-ce.net (deela.quest-ce.net [127.0.0.1]) by deela.quest-ce.net (8.14.4/8.14.4) with ESMTP id p2V9TUoV011642; Thu, 31 Mar 2011 11:29:30 +0200 Received: (from ydroneaud@localhost) by deela.quest-ce.net (8.14.4/8.14.4/Submit) id p2V9TTl7011641; Thu, 31 Mar 2011 11:29:29 +0200 From: Yann Droneaud To: linux-rdma@vger.kernel.org Cc: Yann Droneaud Subject: [PATCH 4/5] read_config: ignore directory entry with backup suffix (~) Date: Thu, 31 Mar 2011 11:29:24 +0200 Message-Id: X-Mailer: git-send-email 1.7.4.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 31 Mar 2011 09:37:46 +0000 (UTC) diff --git a/src/init.c b/src/init.c index 46ff24c..dd6fb00 100644 --- a/src/init.c +++ b/src/init.c @@ -311,6 +311,9 @@ static void read_config(void) if (dent->d_name[0] == '.') continue; + if (dent->d_name[0] == '\0' || dent->d_name[strlen(dent->d_name) - 1] == '~') + 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);