From patchwork Fri Dec 11 03:22:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 66414 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBB3OQmW015595 for ; Fri, 11 Dec 2009 03:24:26 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id A1B7E61B11F; Thu, 10 Dec 2009 22:24:25 -0500 (EST) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id nBB3ONOQ029740 for ; Thu, 10 Dec 2009 22:24:23 -0500 Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.6]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBB3ONBM007890 for ; Thu, 10 Dec 2009 22:24:23 -0500 Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBB3O8Ji008072 for ; Thu, 10 Dec 2009 22:24:08 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id C60AC96B5F for ; Fri, 11 Dec 2009 04:24:07 +0100 (CET) From: NeilBrown To: dm-devel@redhat.com Date: Fri, 11 Dec 2009 14:22:56 +1100 Message-Id: <20091211032402.781887148@suse.de> User-Agent: quilt/0.48-1 References: <20091211032255.766079509@suse.de> Content-Disposition: inline; filename=closedir-fixes X-RedHat-Spam-Score: -6.041 (AWL,RCVD_IN_DNSWL_HI) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.6 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH libdmraid-events 1/3] Add some missing closedir calls. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com --- libdmraid-events.orig/libdmraid-events.c +++ libdmraid-events/libdmraid-events.c @@ -172,6 +172,7 @@ static int _repopulate(const char* devic memcpy(test_path+strlen(sys_path), strchr(disk+1, '/')+1, strlen(strchr(disk+1, '/')+1)); if((dir = opendir(test_path))) { + closedir(dir); /* test path is for this raid volume */ memcpy(test_path+strlen(test_path), "/dev", 4); if(!(fd = fopen(test_path, "r"))) { @@ -959,6 +960,7 @@ int register_device(const char *device, if(!(dir = opendir(test_path))) continue; else { + closedir(dir); /* test path is for this raid volume */ memcpy(rv_next->raid_mem[m].dev_name, scsi_dev, strlen(scsi_dev)); memset(rv_next->raid_mem[m].dev_name+strlen(scsi_dev), 0, 1);