diff --git a/configure.ac b/configure.ac index 79db34a8..b93eaa28 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ AC_CHECK_FUNCS(posix_fadvise) AC_CHECK_FUNCS(strptime) AC_CHECK_FUNCS(strtok_r) AC_CHECK_FUNCS(timegm) +AC_CHECK_FUNCS(euidaccess) dnl Large File Support (LFS) AC_SYS_LARGEFILE diff --git a/src/filescanner.c b/src/filescanner.c index aa887527..fa4d9b1e 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -1244,7 +1244,11 @@ process_inotify_dir(struct watch_info *wi, char *path, struct inotify_event *ie) free(wi->path); wi->path = s; +#ifdef HAVE_EUIDACCESS if (euidaccess(path, (R_OK | X_OK)) < 0) +#else + if (access(path, (R_OK | X_OK)) < 0) +#endif { DPRINTF(E_LOG, L_SCAN, "Directory access to '%s' failed: %s\n", path, strerror(errno)); @@ -1307,7 +1311,11 @@ process_inotify_file(struct watch_info *wi, char *path, struct inotify_event *ie { DPRINTF(E_DBG, L_SCAN, "File permissions changed: %s\n", path); +#ifdef HAVE_EUIDACCESS if (euidaccess(path, R_OK) < 0) +#else + if (access(path, R_OK) < 0) +#endif { DPRINTF(E_LOG, L_SCAN, "File access to '%s' failed: %s\n", path, strerror(errno)); diff --git a/src/transcode.c b/src/transcode.c index 836d72ed..5afdc935 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -367,7 +367,7 @@ transcode(struct transcode_ctx *ctx, struct evbuffer *evbuf, int wanted) #elif LIBAVCODEC_VERSION_MAJOR >= 55 || (LIBAVCODEC_VERSION_MAJOR == 54 && LIBAVCODEC_VERSION_MINOR >= 35) if (frame) avcodec_free_frame(&frame); -#else +#elif LIBAVCODEC_VERSION_MAJOR >= 54 || (LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR >= 35) if (frame) av_free(frame); #endif