aboutsummaryrefslogtreecommitdiff
path: root/lib/util/padd_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/padd_file.c')
-rw-r--r--lib/util/padd_file.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/util/padd_file.c b/lib/util/padd_file.c
deleted file mode 100644
index 1803139..0000000
--- a/lib/util/padd_file.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* SPDX-License-Identifier: LGPL-3.0-or-later */
-/*
- * padd_file.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "config.h"
-
-#include "sqfs/io.h"
-#include "util.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int padd_file(int outfd, sqfs_u64 size, size_t blocksize)
-{
- size_t padd_sz = size % blocksize;
- int status = -1;
- sqfs_u8 *buffer;
-
- if (padd_sz == 0)
- return 0;
-
- padd_sz = blocksize - padd_sz;
-
- buffer = calloc(1, padd_sz);
- if (buffer == NULL)
- goto fail_errno;
-
- if (write_data("padding output file to block size",
- outfd, buffer, padd_sz)) {
- goto out;
- }
-
- status = 0;
-out:
- free(buffer);
- return status;
-fail_errno:
- perror("padding output file to block size");
- goto out;
-}