File iprutils-close.diff of Package iprutils.558

Index: iprutils/iprlib.c
===================================================================
--- iprutils.orig/iprlib.c
+++ iprutils/iprlib.c
@@ -8407,15 +8407,16 @@ int ipr_update_ioa_fw(struct ipr_ioa *io
 		}
 
 		dir = opendir(hotplug_dir);
-		if (!dir)
+		if (!dir) {
 			mkdir(hotplug_dir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
 
-		dir = opendir(hotplug_dir);
-		if (!dir) {
-			syslog(LOG_ERR, "Failed to open %s. %m\n", hotplug_dir);
-			munmap(image_hdr, ucode_stats.st_size);
-			close(fd);
-			return -EIO;
+			dir = opendir(hotplug_dir);
+			if (!dir) {
+			    syslog(LOG_ERR, "Failed to open %s. %m\n", hotplug_dir);
+			    munmap(image_hdr, ucode_stats.st_size);
+			    close(fd);
+			    return -EIO;
+		    }
 		}
 		closedir(dir);
 		sprintf(ucode_file, "%s/.%s", hotplug_dir, tmp);
openSUSE Build Service is sponsored by