]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/partx.c
wipefs: add --lock and LOCK_BLOCK_DEVICE
[thirdparty/util-linux.git] / disk-utils / partx.c
index e1f6b8f9e40f7f3ffc3acede03dcc4055e545328..07b3e28b9e88b7d840fee7670c255762fd8d51e7 100644 (file)
@@ -245,7 +245,7 @@ static int get_max_partno(const char *disk, dev_t devno)
                if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
                        continue;
 #endif
-               if (strncmp(parent, d->d_name, strlen(parent)))
+               if (strncmp(parent, d->d_name, strlen(parent)) != 0)
                        continue;
                snprintf(path, sizeof(path), "%s/partition", d->d_name);
 
@@ -332,7 +332,9 @@ static int del_parts(int fd, const char *device, dev_t devno,
                        if (verbose)
                                printf(_("%s: partition #%d removed\n"), device, i);
                        continue;
-               } else if (errno == ENXIO) {
+               }
+
+               if (errno == ENXIO) {
                        if (verbose)
                                printf(_("%s: partition #%d doesn't exist\n"), device, i);
                        continue;