svn commit: r278738 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io
Mark Johnston
markj at FreeBSD.org
Sat Feb 14 00:03:45 UTC 2015
Author: markj
Date: Sat Feb 14 00:03:43 2015
New Revision: 278738
URL: https://svnweb.freebsd.org/changeset/base/278738
Log:
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
Modified:
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d
Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Fri Feb 13 23:57:20 2015 (r278737)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c Sat Feb 14 00:03:43 2015 (r278738)
@@ -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);
Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d Fri Feb 13 23:57:20 2015 (r278737)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d Sat Feb 14 00:03:43 2015 (r278738)
@@ -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);
More information about the svn-src-all
mailing list