diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-04-05 09:59:41 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-04-05 02:39:09 +0200 |
commit | 0732311c805d83b06ccd6c56512723c50b5c83d6 (patch) | |
tree | 906bb257c129e6ee8c4a5d114c63b066efcfc194 /tests | |
parent | 22d9450100fd33ef3cc1fcb0fb92a1a20da5be75 (diff) | |
download | samba-0732311c805d83b06ccd6c56512723c50b5c83d6.tar.gz samba-0732311c805d83b06ccd6c56512723c50b5c83d6.tar.bz2 samba-0732311c805d83b06ccd6c56512723c50b5c83d6.zip |
build: Add more assertions that fcntl locking works 64-bit
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fcntl_lock.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/fcntl_lock.c b/tests/fcntl_lock.c index 3dc12a3897..98d028572e 100644 --- a/tests/fcntl_lock.c +++ b/tests/fcntl_lock.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; - lock.l_start = 0; + lock.l_start = 0x100000000LL; lock.l_len = 4; lock.l_pid = getpid(); @@ -92,16 +92,27 @@ int main(int argc, char *argv[]) lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; - lock.l_len = 4; + lock.l_len = 0x100000004LL; lock.l_pid = getpid(); - /* set a 4 byte write lock */ - fcntl(fd,F_SETLK,&lock); + /* set a 100000004 byte write lock, should conflict with the above */ + ret = fcntl(fd,F_SETLK,&lock); sys_waitpid(pid, &status, 0); unlink(DATA); + if (ret != 0) { + fprintf(stderr,"ERROR: failed to lock %s (errno=%d)\n", + DATA, (int)errno); + exit(1); + } + + if (lock.l_len < 0x100000004LL) { + fprintf(stderr,"ERROR: settign lock overflowed\n"); + exit(1); + } + #if defined(WIFEXITED) && defined(WEXITSTATUS) if(WIFEXITED(status)) { status = WEXITSTATUS(status); |