aboutsummaryrefslogtreecommitdiff
path: root/ubifs-utils/common
diff options
context:
space:
mode:
Diffstat (limited to 'ubifs-utils/common')
-rw-r--r--ubifs-utils/common/README17
-rw-r--r--ubifs-utils/common/atomic.h6
-rw-r--r--ubifs-utils/common/defs.h5
-rw-r--r--ubifs-utils/common/devtable.c1
4 files changed, 18 insertions, 11 deletions
diff --git a/ubifs-utils/common/README b/ubifs-utils/common/README
index a93ebd0..8fe716e 100644
--- a/ubifs-utils/common/README
+++ b/ubifs-utils/common/README
@@ -1,14 +1,13 @@
Common Library
-* crc16.h and crc16.c were copied from the linux kernel.
-* crc32.h and crc32.c were copied from mtd-utils and amended.
+* crc16.h and crc16.c were copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/crc16.c).
* defs.h is a bunch of definitions to smooth things over.
* hashtable/* was downloaded from http://www.cl.cam.ac.uk/~cwc22/hashtable/
* atomic.h was downloaded from https://the-linux-channel.the-toffee-project.org/index.php?page=6-tutorials-linux-user-space-atomic-operations
-* bitops.h and bitops.c were copied from the linux kernel.
-* compiler_attributes.h was copied from the linux kernel.
-* linux_types.h was copied from the linux kernel.
-* linux_err.h was copied from the linux kernel.
-* hexdump.c was copied from the linux kernel.
-* kmem.h and kmem.c were partial copied from xfsprogs-dev (https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/)
-* sort.h and sort.c were copied from the linux kernel.
+* bitops.h and bitops.c were copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/find_bit.c).
+* compiler_attributes.h was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/include/linux/compiler_attributes.h).
+* linux_types.h was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/include/linux/types.h overflow.h fscrypt.h).
+* linux_err.h was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/include/linux/err.h).
+* hexdump.c was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/hexdump.c).
+* kmem.h and kmem.c were partial copied from xfsprogs-dev(https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/).
+* sort.h and sort.c were copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/sort.c).
diff --git a/ubifs-utils/common/atomic.h b/ubifs-utils/common/atomic.h
index f287d43..95754b2 100644
--- a/ubifs-utils/common/atomic.h
+++ b/ubifs-utils/common/atomic.h
@@ -2,8 +2,12 @@
#ifndef __ATOMIC_H__
#define __ATOMIC_H__
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+
/* Check GCC version, just to be safe */
-#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1)
+#if GCC_VERSION < 40100
# error atomic.h works only with GCC newer than version 4.1
#endif /* GNUC >= 4.1 */
diff --git a/ubifs-utils/common/defs.h b/ubifs-utils/common/defs.h
index 7ff1771..d5edbf6 100644
--- a/ubifs-utils/common/defs.h
+++ b/ubifs-utils/common/defs.h
@@ -13,8 +13,11 @@
#include <errno.h>
#include <time.h>
#include <assert.h>
+#if HAVE_EXECINFO_H
#include <execinfo.h>
-
+#else
+#include "libmissing.h"
+#endif
#include "ubifs.h"
/* common.h requires the PROGRAM_NAME macro */
diff --git a/ubifs-utils/common/devtable.c b/ubifs-utils/common/devtable.c
index 7347f09..2e581ff 100644
--- a/ubifs-utils/common/devtable.c
+++ b/ubifs-utils/common/devtable.c
@@ -392,6 +392,7 @@ int parse_devtable(const char *tbl_file)
out_close:
fclose(f);
+ free(line);
free_devtable_info();
return -1;
}