aboutsummaryrefslogtreecommitdiff
path: root/lib/common/perror.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-31 11:21:30 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-31 13:51:49 +0100
commitcdccc69c62579b0c13b35fad0728079652b8f3c9 (patch)
tree9fa54c710f73c5e08a9c8466e7a712eb63ee07ac /lib/common/perror.c
parent2182129c8f359c4fa1390eaba7a65b595ccd4182 (diff)
Move library source into src sub-directory
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/common/perror.c')
-rw-r--r--lib/common/perror.c79
1 files changed, 0 insertions, 79 deletions
diff --git a/lib/common/perror.c b/lib/common/perror.c
deleted file mode 100644
index 53a8c16..0000000
--- a/lib/common/perror.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * print_version.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "common.h"
-
-#include <stdio.h>
-
-void sqfs_perror(const char *file, const char *action, int error_code)
-{
- const char *errstr;
-
- switch (error_code) {
- case SQFS_ERROR_ALLOC:
- errstr = "out of memory";
- break;
- case SQFS_ERROR_IO:
- errstr = "I/O error";
- break;
- case SQFS_ERROR_COMPRESSOR:
- errstr = "internal compressor error";
- break;
- case SQFS_ERROR_INTERNAL:
- errstr = "internal error";
- break;
- case SQFS_ERROR_CORRUPTED:
- errstr = "data corrupted";
- break;
- case SQFS_ERROR_UNSUPPORTED:
- errstr = "unknown or not supported";
- break;
- case SQFS_ERROR_OVERFLOW:
- errstr = "numeric overflow";
- break;
- case SQFS_ERROR_OUT_OF_BOUNDS:
- errstr = "location out of bounds";
- break;
- case SFQS_ERROR_SUPER_MAGIC:
- errstr = "wrong magic value in super block";
- break;
- case SFQS_ERROR_SUPER_VERSION:
- errstr = "wrong squashfs version in super block";
- break;
- case SQFS_ERROR_SUPER_BLOCK_SIZE:
- errstr = "invalid block size specified in super block";
- break;
- case SQFS_ERROR_NOT_DIR:
- errstr = "target is not a directory";
- break;
- case SQFS_ERROR_NO_ENTRY:
- errstr = "no such file or directory";
- break;
- case SQFS_ERROR_LINK_LOOP:
- errstr = "hard link loop detected";
- break;
- case SQFS_ERROR_NOT_FILE:
- errstr = "target is not a file";
- break;
- case SQFS_ERROR_ARG_INVALID:
- errstr = "invalid argument";
- break;
- case SQFS_ERROR_SEQUENCE:
- errstr = "illegal oder of operations";
- break;
- default:
- errstr = "libsquashfs returned an unknown error code";
- break;
- }
-
- if (file != NULL)
- fprintf(stderr, "%s: ", file);
-
- if (action != NULL)
- fprintf(stderr, "%s: ", action);
-
- fprintf(stderr, "%s.\n", errstr);
-}