PERFORCE change 113754 for review
Robert Watson
rwatson at FreeBSD.org
Wed Jan 31 11:05:18 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113754
Change 113754 by rwatson at rwatson_cinnamon on 2007/01/31 11:04:54
When testing the setzbuf ioctl and a failure is supposed to have
occurred, check that the setzbuf ioctl didn't set the buffer, rather
than that it did set the buffer.
Affected files ...
.. //depot/projects/zcopybpf/utils/zbuf_ioctl/zbuf_ioctl.c#3 edit
Differences ...
==== //depot/projects/zcopybpf/utils/zbuf_ioctl/zbuf_ioctl.c#3 (text+ko) ====
@@ -151,11 +151,19 @@
if (ret < 0)
err(-1, "bpf_test_setzbuf(%s): bpf_getzbuf() to confirm "
"results failed", desc);
- if (bufa_check != bufa || bufb_check != bufb ||
- buflen != buflen_check)
- errx(-1, "bpf_test_setzbuf(%s): getzbuf returned "
- "(0x%x, 0x%x, %d)", desc, (uintptr_t)bufa_check,
- (uintptr_t)bufb_check, buflen_check);
+ if (error == 0) {
+ if (bufa_check != bufa || bufb_check != bufb ||
+ buflen != buflen_check)
+ errx(-1, "bpf_test_setzbuf(%s): getzbuf returned "
+ "(0x%x, 0x%x, %d)", desc, (uintptr_t)bufa_check,
+ (uintptr_t)bufb_check, buflen_check);
+ } else {
+ if (bufa_check != NULL || bufb_check != NULL ||
+ buflen_check != 0)
+ errx(-1, "bpf_test_setzbuf(%s): getzbuf returned "
+ "(0x%x, 0x%x, %d)", desc, (uintptr_t)bufa_check,
+ (uintptr_t)bufb_check, buflen_check);
+ }
out:
close(fd);
}
More information about the p4-projects
mailing list