Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6e06d2f
)
Improved the program that checks for broken large-file locking.
author
Wayne Davison
<wayned@samba.org>
Fri, 30 Apr 2004 17:38:22 +0000
(17:38 +0000)
committer
Wayne Davison
<wayned@samba.org>
Fri, 30 Apr 2004 17:38:22 +0000
(17:38 +0000)
configure.in
patch
|
blob
|
blame
|
history
diff --git
a/configure.in
b/configure.in
index
245a769
..
000a723
100644
(file)
--- a/
configure.in
+++ b/
configure.in
@@
-146,21
+146,26
@@
AC_TRY_RUN([
int main(void)
{
struct flock lock;
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;
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) {
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));
}
],
exit(WEXITSTATUS(status));
}
],