diff options
Diffstat (limited to 'src/boot/bootctl.c')
-rw-r--r-- | src/boot/bootctl.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index faab82dbb8..f991e30cfa 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -20,28 +20,27 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <stdio.h> -#include <getopt.h> -#include <stdlib.h> #include <assert.h> -#include <sys/statfs.h> -#include <sys/stat.h> -#include <errno.h> -#include <string.h> -#include <unistd.h> -#include <sys/mman.h> -#include <dirent.h> +#include <blkid/blkid.h> #include <ctype.h> -#include <limits.h> +#include <dirent.h> +#include <errno.h> #include <ftw.h> +#include <getopt.h> +#include <limits.h> #include <stdbool.h> -#include <blkid/blkid.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/mman.h> +#include <sys/stat.h> +#include <sys/statfs.h> +#include <unistd.h> +#include "blkid-util.h" #include "efivars.h" -#include "build.h" -#include "util.h" #include "rm-rf.h" -#include "blkid-util.h" +#include "util.h" static int verify_esp(const char *p, uint32_t *part, uint64_t *pstart, uint64_t *psize, sd_id128_t *uuid) { struct statfs sfs; @@ -294,6 +293,8 @@ static int status_binaries(const char *esp_path, sd_id128_t partition) { else if (r < 0) return r; + printf("\n"); + return 0; } @@ -487,9 +488,9 @@ static int copy_file(const char *from, const char *to, bool force) { } } while (!feof(f)); - fflush(g); - if (ferror(g)) { - r = log_error_errno(EIO, "Failed to write \"%s\": %m", to); + r = fflush_and_check(g); + if (r < 0) { + log_error_errno(r, "Failed to write \"%s\": %m", to); goto error; } @@ -517,7 +518,7 @@ static int copy_file(const char *from, const char *to, bool force) { return 0; error: - unlink(p); + (void) unlink(p); return r; } @@ -816,7 +817,7 @@ static int remove_boot_efi(const char *esp_path) { if (r < 0) return log_error_errno(errno, "Failed to remove \"%s/%s\": %m", p, de->d_name); - log_info("Removed \"%s/\%s\".", p, de->d_name); + log_info("Removed \"%s/%s\".", p, de->d_name); } c++; @@ -965,8 +966,7 @@ static int parse_argv(int argc, char *argv[]) { return 0; case ARG_VERSION: - printf(VERSION "\n"); - return 0; + return version(); case ARG_PATH: arg_path = optarg; |