mirror of
https://github.com/containers/fuse-overlayfs.git
synced 2025-09-11 08:16:05 -04:00
commit
536abddd91
@ -32,7 +32,7 @@ PKG_CHECK_MODULES([FUSE], [fuse3 >= 3.2.1], [AC_DEFINE([HAVE_FUSE], 1, [Define i
|
|||||||
|
|
||||||
AC_FUNC_ERROR_AT_LINE
|
AC_FUNC_ERROR_AT_LINE
|
||||||
AC_FUNC_MALLOC
|
AC_FUNC_MALLOC
|
||||||
AC_CHECK_FUNCS([memset strdup])
|
AC_CHECK_FUNCS([open_by_handle_at error memset strdup])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile lib/Makefile])
|
AC_CONFIG_FILES([Makefile lib/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
44
main.c
44
main.c
@ -36,7 +36,23 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <error.h>
|
|
||||||
|
#ifdef HAVE_ERROR_H
|
||||||
|
# include <error.h>
|
||||||
|
#else
|
||||||
|
# define error(status, errno, fmt, ...) do { \
|
||||||
|
if (errno == 0) \
|
||||||
|
fprintf (stderr, "crun: " fmt "\n", ##__VA_ARGS__); \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
fprintf (stderr, "crun: " fmt, ##__VA_ARGS__); \
|
||||||
|
fprintf (stderr, ": %s\n", strerror (errno)); \
|
||||||
|
} \
|
||||||
|
if (status) \
|
||||||
|
exit (status); \
|
||||||
|
} while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <hash.h>
|
#include <hash.h>
|
||||||
@ -57,6 +73,32 @@
|
|||||||
|
|
||||||
#include <utils.h>
|
#include <utils.h>
|
||||||
|
|
||||||
|
#ifndef TEMP_FAILURE_RETRY
|
||||||
|
#define TEMP_FAILURE_RETRY(expression) \
|
||||||
|
(__extension__ \
|
||||||
|
({ long int __result; \
|
||||||
|
do __result = (long int) (expression); \
|
||||||
|
while (__result == -1L && errno == EINTR); \
|
||||||
|
__result; }))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef HAVE_OPEN_BY_HANDLE_AT
|
||||||
|
struct file_handle
|
||||||
|
{
|
||||||
|
unsigned int handle_bytes; /* Size of f_handle [in, out] */
|
||||||
|
int handle_type; /* Handle type [out] */
|
||||||
|
unsigned char f_handle[0]; /* File identifier (sized by
|
||||||
|
caller) [out] */
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
open_by_handle_at (int mount_fd, struct file_handle *handle, int flags)
|
||||||
|
{
|
||||||
|
return syscall (SYS_open_by_handle_at, mount_fd, handle, flags);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef RENAME_EXCHANGE
|
#ifndef RENAME_EXCHANGE
|
||||||
# define RENAME_EXCHANGE (1 << 1)
|
# define RENAME_EXCHANGE (1 << 1)
|
||||||
# define RENAME_NOREPLACE (1 << 2)
|
# define RENAME_NOREPLACE (1 << 2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user