From b969d3990a5b21905e21ecb572e3ab1f19f52ccb Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Mon, 20 Dec 2021 15:21:17 +0100 Subject: [PATCH] Cleanup --- src/raspberrypi/rascsi_image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raspberrypi/rascsi_image.cpp b/src/raspberrypi/rascsi_image.cpp index 5b4e449d..530bd232 100644 --- a/src/raspberrypi/rascsi_image.cpp +++ b/src/raspberrypi/rascsi_image.cpp @@ -136,7 +136,7 @@ bool RascsiImage::CreateImage(int fd, const PbCommand& command) string folder = default_image_folder + "/" + filename.substr(0, slash_position); 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)); } } @@ -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))); } - if (fallocate(image_fd, 0, 0, len) == -1) { + if (fallocate(image_fd, 0, 0, len)) { close(image_fd); unlink(full_filename.c_str());