mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-02 09:35:58 +00:00
Cleanup
This commit is contained in:
parent
6a6efa6bdd
commit
b969d3990a
@ -136,7 +136,7 @@ bool RascsiImage::CreateImage(int fd, const PbCommand& command)
|
|||||||
string folder = default_image_folder + "/" + filename.substr(0, slash_position);
|
string folder = default_image_folder + "/" + filename.substr(0, slash_position);
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat(folder.c_str(), &st) && mkdir(folder.c_str(), 0777) == -1) {
|
if (stat(folder.c_str(), &st) && mkdir(folder.c_str(), 0777)) {
|
||||||
return ReturnStatus(fd, false, "Can't create folder '" + folder + "': " + strerror(errno));
|
return ReturnStatus(fd, false, "Can't create folder '" + folder + "': " + strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ bool RascsiImage::CreateImage(int fd, const PbCommand& command)
|
|||||||
return ReturnStatus(fd, false, "Can't create image file '" + full_filename + "': " + string(strerror(errno)));
|
return ReturnStatus(fd, false, "Can't create image file '" + full_filename + "': " + string(strerror(errno)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fallocate(image_fd, 0, 0, len) == -1) {
|
if (fallocate(image_fd, 0, 0, len)) {
|
||||||
close(image_fd);
|
close(image_fd);
|
||||||
|
|
||||||
unlink(full_filename.c_str());
|
unlink(full_filename.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user