summaryrefslogtreecommitdiff
path: root/source3/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-05-02 06:52:25 +0000
committerAndrew Tridgell <tridge@samba.org>2001-05-02 06:52:25 +0000
commit9019718582850e20d3e1506b020116e8b2cb2016 (patch)
tree767b1e01d85d8c98ae32eef75f0d380650bcac36 /source3/tests
parentf5eab4421c0fcda6907259cb91ba091e9cca5eae (diff)
downloadsamba-9019718582850e20d3e1506b020116e8b2cb2016.tar.gz
samba-9019718582850e20d3e1506b020116e8b2cb2016.tar.bz2
samba-9019718582850e20d3e1506b020116e8b2cb2016.zip
added error msgs to fcntl_lock test
(This used to be commit db5d38736d0d91acb55f4e4a67f33a2c0b5fdca3)
Diffstat (limited to 'source3/tests')
-rw-r--r--source3/tests/fcntl_lock.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source3/tests/fcntl_lock.c b/source3/tests/fcntl_lock.c
index 32aecb8743..1f67679c8c 100644
--- a/source3/tests/fcntl_lock.c
+++ b/source3/tests/fcntl_lock.c
@@ -44,7 +44,11 @@ int main(int argc, char *argv[])
sleep(2);
fd = open(DATA, O_RDONLY);
- if (fd == -1) exit(1);
+ if (fd == -1) {
+ fprintf(stderr,"ERROR: failed to open %s (errno=%d)\n",
+ DATA, (int)errno);
+ exit(1);
+ }
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
@@ -59,6 +63,7 @@ int main(int argc, char *argv[])
if ((ret == -1) ||
(lock.l_type == F_UNLCK)) {
+ fprintf(stderr,"ERROR: lock test failed (ret=%d errno=%d)\n", ret, (int)errno);
exit(1);
} else {
exit(0);
@@ -67,6 +72,12 @@ int main(int argc, char *argv[])
fd = open(DATA, O_RDWR|O_CREAT|O_TRUNC, 0600);
+ if (fd == -1) {
+ fprintf(stderr,"ERROR: failed to open %s (errno=%d)\n",
+ DATA, (int)errno);
+ exit(1);
+ }
+
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
@@ -90,5 +101,10 @@ int main(int argc, char *argv[])
status = (status == 0) ? 0 : 1;
#endif /* defined(WIFEXITED) && defined(WEXITSTATUS) */
+ if (status) {
+ fprintf(stderr,"ERROR: lock test failed with status=%d\n",
+ status);
+ }
+
exit(status);
}