AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(sys/fcntl.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
+AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h)
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS(waitpid strtok pipe getcwd mkdir strdup strerror chown chmod mknod)
AC_CHECK_FUNCS(fchmod fstat strchr bcopy bzero readlink link utime utimes)
-AC_CHECK_FUNCS(memmove getopt_long)
+AC_CHECK_FUNCS(memmove getopt_long lchown)
echo $ac_n "checking for working fnmatch... $ac_c"
AC_TRY_RUN([#include <fnmatch.h>
p = strrchr(fname,'/');
if (p) {
*p = 0;
- dir = fname;
+ if (p == fname)
+ dir = "/";
+ else
+ dir = fname;
fname = p+1;
}
if (!*fname)
if (strcmp(dir,".")) {
int l = strlen(dir);
+ if (strcmp(dir,"/") == 0)
+ l = 0;
for (i=0;i<argc;i++)
argv[i] += l+1;
}
if ((am_root && preserve_uid && st->st_uid != file->uid) ||
(preserve_gid && st->st_gid != file->gid)) {
updated = 1;
- if (chown(fname,
- (am_root&&preserve_uid)?file->uid:-1,
- preserve_gid?file->gid:-1) != 0) {
+ if (lchown(fname,
+ (am_root&&preserve_uid)?file->uid:-1,
+ preserve_gid?file->gid:-1) != 0) {
if (verbose>1 || preserve_uid)
fprintf(FERROR,"chown %s : %s\n",fname,strerror(errno));
return updated;
#include <utime.h>
#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
#ifdef HAVE_FNMATCH
#include <fnmatch.h>
#else
#define lstat stat
#endif
+#ifndef HAVE_LCHOWN
+#define lchown chown
+#endif
+
#define SIGNAL_CAST (RETSIGTYPE (*)())
#ifndef EWOULDBLOCK
-#define VERSION "1.6.0"
+#define VERSION "1.6.1"