3 @@ -42,7 +42,7 @@ DAV_CHECK_NEON
4 # Checks for header files.
7 -AC_CHECK_HEADERS([fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h syslog.h termios.h unistd.h utime.h])
8 +AC_CHECK_HEADERS([error.h fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h sys/select.h sys/types.h syslog.h termios.h unistd.h utime.h])
10 # Checks for typedefs, structures, and compiler characteristics.
12 @@ -78,7 +78,7 @@ AC_FUNC_SELECT_ARGTYPES
16 -AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime])
17 +AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime canonicalize_file_name fopencookie])
40 #ifdef HAVE_SYS_STAT_H
43 +#ifdef HAVE_SYS_SELECT_H
44 +#include <sys/select.h>
48 #include "mount_davfs.h"
49 --- a/src/kernel_interface.c
50 +++ b/src/kernel_interface.c
62 #ifdef HAVE_SYS_STAT_H
65 +#ifdef HAVE_SYS_TYPES_H
66 +#include <sys/types.h>
71 --- a/src/mount_davfs.c
72 +++ b/src/mount_davfs.c
85 --- a/src/umount_davfs.c
86 +++ b/src/umount_davfs.c
110 @@ -368,6 +368,7 @@ dav_init_webdav(const dav_args *args)
111 error(EXIT_FAILURE, errno, _("socket library initialization failed"));
113 if (args->neon_debug & ~NE_DBG_HTTPPLAIN) {
114 +#ifdef HAVE_FOPENCOOKIE
115 char *buf = malloc(log_bufsize);
116 cookie_io_functions_t *log_func = malloc(sizeof(cookie_io_functions_t));
117 if (!log_func) abort();
118 @@ -380,6 +381,9 @@ dav_init_webdav(const dav_args *args)
119 error(EXIT_FAILURE, errno,
120 _("can't open stream to log neon-messages"));
121 ne_debug_init(log_stream, args->neon_debug);
123 + error(EXIT_FAILURE, 0, "neon debugging unsupported");
127 session = ne_session_create(args->scheme, args->host, args->port);
134 +#ifndef _PATH_MOUNTED
135 +# define _PATH_MOUNTED "/proc/mounts"
138 +#ifndef _PATH_MNTTAB
139 +# define _PATH_MNTTAB "/etc/fstab"
146 +# include <stdarg.h>
147 +# include <stdlib.h>
148 +# include <string.h>
149 +static void error_at_line(int status, int errnum, const char *filename,
150 + unsigned int linenum, const char *format, ...)
156 + if (filename != NULL)
157 + fprintf(stderr, "%s:%u: ", filename, linenum);
159 + va_start(ap, format);
160 + vfprintf(stderr, format, ap);
164 + fprintf(stderr, ": %s", strerror(errnum));
166 + fprintf(stderr, "\n");
172 +#define error(status, errnum, format...) \
173 + error_at_line(status, errnum, NULL, 0, format)
175 +#endif /* HAVE_ERROR_H */
177 +#ifndef HAVE_CANONICALIZE_FILE_NAME
181 +static char * canonicalize_file_name(const char *path)
183 + char buf[PATH_MAX] = { };
185 + snprintf(buf, sizeof(buf) - 1, "%s", path);
187 + if (!realpath(path, buf))
190 + return strdup(buf);
194 +#endif /* _COMPAT_H */