diff options
author | markj <markj@FreeBSD.org> | 2015-02-14 00:03:43 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2015-02-14 00:03:43 +0000 |
commit | 81644b962a02b605461dd461fe14cc294d0e3650 (patch) | |
tree | 2e1247c6599385048e45effac40f371cf82ef898 /cddl/contrib/opensolaris/cmd/dtrace/test/tst | |
parent | a9731f30c8eef0c07813f21884d05d8f12dc1dd9 (diff) | |
download | FreeBSD-src-81644b962a02b605461dd461fe14cc294d0e3650.zip FreeBSD-src-81644b962a02b605461dd461fe14cc294d0e3650.tar.gz |
Tweak the fds test program so that it actually compiles. Also use 0 instead
of -1 for the bogus ioctl command so that dmesg doesn't get spammed with
sign extension warnings when the test program runs.
MFC after: 1 week
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/dtrace/test/tst')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c | 13 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c index 3cded11..9b878a2 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c @@ -26,6 +26,8 @@ #pragma ident "%Z%%M% %I% %E% SMI" +#include <sys/ioctl.h> + #include <assert.h> #include <setjmp.h> #include <signal.h> @@ -69,7 +71,7 @@ main(int argc, char *argv[]) */ if (sigsetjmp(env, 1) == 0) { for (;;) - (void) ioctl(-1, -1, NULL); + (void) ioctl(-1, 0, NULL); } /* @@ -80,20 +82,19 @@ main(int argc, char *argv[]) fds[n++] = open(file, O_WRONLY); fds[n++] = open(file, O_RDWR); - fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC | - O_LARGEFILE | O_NOCTTY | O_NONBLOCK | O_NDELAY | O_RSYNC | - O_SYNC | O_TRUNC | O_XATTR, 0666); + fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | + O_NOCTTY | O_NONBLOCK | O_NDELAY | O_SYNC | O_TRUNC | 0666); fds[n++] = open(file, O_RDWR); (void) lseek(fds[n - 1], 123, SEEK_SET); /* * Once we have all the file descriptors in the state we want to test, - * issue a bogus ioctl() on each fd with cmd -1 and arg NULL to whack + * issue a bogus ioctl() on each fd with cmd 0 and arg NULL to whack * our DTrace script into recording the content of the fds[] array. */ for (i = 0; i < n; i++) - (void) ioctl(fds[i], -1, NULL); + (void) ioctl(fds[i], 0, NULL); assert(n <= sizeof (fds) / sizeof (fds[0])); exit(0); diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d index 52a3312..8685142 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d @@ -36,7 +36,7 @@ syscall::ioctl:entry } syscall::ioctl:entry -/pid == $1 && arg0 != -1u && arg1 == -1u && arg2 == NULL/ +/pid == $1 && arg0 != -1u && arg1 == 0 && arg2 == NULL/ { printf("fds[%d] fi_name = %s\n", arg0, fds[arg0].fi_name); printf("fds[%d] fi_dirname = %s\n", arg0, fds[arg0].fi_dirname); |