Merge "Handle BLKDISCARD failures"
This commit is contained in:
commit
aa4df5c45b
1 changed files with 1 additions and 2 deletions
|
@ -1485,7 +1485,6 @@ static int PerformCommandErase(CommandParameters* params) {
|
||||||
|
|
||||||
if (!S_ISBLK(st.st_mode)) {
|
if (!S_ISBLK(st.st_mode)) {
|
||||||
fprintf(stderr, "not a block device; skipping erase\n");
|
fprintf(stderr, "not a block device; skipping erase\n");
|
||||||
rc = 0;
|
|
||||||
goto pceout;
|
goto pceout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1509,7 +1508,7 @@ static int PerformCommandErase(CommandParameters* params) {
|
||||||
|
|
||||||
if (ioctl(params->fd, BLKDISCARD, &blocks) == -1) {
|
if (ioctl(params->fd, BLKDISCARD, &blocks) == -1) {
|
||||||
fprintf(stderr, "BLKDISCARD ioctl failed: %s\n", strerror(errno));
|
fprintf(stderr, "BLKDISCARD ioctl failed: %s\n", strerror(errno));
|
||||||
// Continue anyway, nothing we can do
|
goto pceout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue