summaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/tdb/patches/replace-includes
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 09:25:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 09:25:10 +0000
commit5dced3d1b3deca80e01415a2e35dc7972dcbfae7 (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /lib/ext2fs/tdb/patches/replace-includes
parentInitial commit. (diff)
downloade2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.tar.xz
e2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.zip
Adding upstream version 1.47.0.upstream/1.47.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ext2fs/tdb/patches/replace-includes')
-rw-r--r--lib/ext2fs/tdb/patches/replace-includes92
1 files changed, 92 insertions, 0 deletions
diff --git a/lib/ext2fs/tdb/patches/replace-includes b/lib/ext2fs/tdb/patches/replace-includes
new file mode 100644
index 0000000..f4181c1
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/replace-includes
@@ -0,0 +1,92 @@
+Index: tdb/tdb.c
+===================================================================
+--- tdb.orig/tdb.c
++++ tdb/tdb.c
+@@ -29,11 +29,82 @@ Last Changed Date: 2007-06-22 13:36:10 -
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#include "replace.h"
+-#include "system/filesys.h"
+-#include "system/time.h"
+-#include "system/shmem.h"
+-#include "system/select.h"
++#ifdef CONFIG_STAND_ALONE
++#define HAVE_MMAP
++#define HAVE_STRDUP
++#define HAVE_SYS_MMAN_H
++#define HAVE_UTIME_H
++#define HAVE_UTIME
++#endif
++#define _XOPEN_SOURCE 500
++
++#include <unistd.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdarg.h>
++#include <stddef.h>
++#include <errno.h>
++#include <string.h>
++#ifdef HAVE_SYS_SELECT_H
++#include <sys/select.h>
++#endif
++#include <sys/time.h>
++#include <sys/types.h>
++#include <time.h>
++#ifdef HAVE_UTIME_H
++#include <utime.h>
++#endif
++#include <sys/stat.h>
++#include <sys/file.h>
++#include <fcntl.h>
++
++#ifdef HAVE_SYS_MMAN_H
++#include <sys/mman.h>
++#endif
++
++#ifndef MAP_FILE
++#define MAP_FILE 0
++#endif
++
++#ifndef MAP_FAILED
++#define MAP_FAILED ((void *)-1)
++#endif
++
++#ifndef HAVE_STRDUP
++#define strdup rep_strdup
++static char *rep_strdup(const char *s)
++{
++ char *ret;
++ int length;
++ if (!s)
++ return NULL;
++
++ if (!length)
++ length = strlen(s);
++
++ ret = malloc(length + 1);
++ if (ret) {
++ strncpy(ret, s, length);
++ ret[length] = '\0';
++ }
++ return ret;
++}
++#endif
++
++#ifndef PRINTF_ATTRIBUTE
++#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++/** Use gcc attribute to check printf fns. a1 is the 1-based index of
++ * the parameter containing the format, and a2 the index of the first
++ * argument. Note that some gcc 2.x versions don't handle this
++ * properly **/
++#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
++#else
++#define PRINTF_ATTRIBUTE(a1, a2)
++#endif
++#endif
++
++typedef int bool;
++
+ #include "tdb.h"
+
+ #ifndef u32