- Improved option_error() to make sure that the user sees the error in
[rsync/rsync.git] / configure.in
index 2b16ff0..f0ecce9 100644 (file)
@@ -5,7 +5,7 @@ AC_CONFIG_SRCDIR([byteorder.h])
 AC_CONFIG_HEADER(config.h)
 AC_PREREQ(2.52)
 
-RSYNC_VERSION=2.6.1pre-1
+RSYNC_VERSION=2.6.2
 AC_SUBST(RSYNC_VERSION)
 AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
 
@@ -146,21 +146,26 @@ AC_TRY_RUN([
 int main(void)
 {
        struct flock lock;
-        int status;
-       int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600);
+       int status;
+       char tpl[32] = "/tmp/locktest.XXXXXX";
+       int fd = mkstemp(tpl);
+       if (fd < 0) {
+               strcpy(tpl, "conftest.dat");
+               fd = open(tpl, O_CREAT|O_RDWR, 0600);
+       }
+
        lock.l_type = F_WRLCK;
        lock.l_whence = SEEK_SET;
        lock.l_start = 0;
        lock.l_len = 1;
        lock.l_pid = 0;
-       
        fcntl(fd,F_SETLK,&lock);
        if (fork() == 0) {
-               lock.l_start = 1;               
-               exit(fcntl(fd,F_SETLK,&lock) == 0);
-        }
-        wait(&status);
-       unlink("conftest.dat");
+               lock.l_start = 1;
+               _exit(fcntl(fd,F_SETLK,&lock) == 0);
+       }
+       wait(&status);
+       unlink(tpl);
        exit(WEXITSTATUS(status));
 }
 ],
@@ -282,8 +287,9 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
     unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \
     sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \
-    sys/un.h glob.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h \
-    netdb.h malloc.h float.h sys/mkdev.h)
+    sys/un.h glob.h mcheck.h arpa/inet.h arpa/nameser.h \
+    netdb.h malloc.h float.h)
+AC_HEADER_MAJOR
 
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)