From 5cb8c75f8c90c252b0041f57d3a8def53e4f719e Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 23 Jan 2021 22:31:02 +0100 Subject: [PATCH] undelete: implement a stub for getdents() on macOS --- src/plugins/undelete.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/undelete.c b/src/plugins/undelete.c index c246021..37521b2 100644 --- a/src/plugins/undelete.c +++ b/src/plugins/undelete.c @@ -31,7 +31,9 @@ #include #include #include -#ifdef __linux__ +#if defined(__APPLE__) +# include +#elif defined(__linux__) # include # include # include @@ -89,7 +91,7 @@ static GtkWidget * _undelete_get_widget(Undelete * undelete); static void _undelete_refresh(Undelete * undelete, GList * selection); /* useful */ -#ifdef __linux__ +#if defined(__APPLE__) || defined(__linux__) static int getdents(int fd, char * buf, unsigned int count); #endif @@ -191,7 +193,13 @@ static void _undelete_refresh(Undelete * undelete, GList * selection) /* useful */ -#ifdef __linux__ +#if defined(__APPLE__) +static int getdents(int fd, char * buf, unsigned int count) +{ + errno = ENOSYS; + return -1; +} +#elif defined(__linux__) static int getdents(int fd, char * buf, unsigned int count) { return syscall(__NR_getdents64, fd, buf, count);