Date: Wed, 31 Jan 2007 11:05:17 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 113754 for review Message-ID: <200701311105.l0VB5Hhj020002@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113754 Change 113754 by rwatson@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701311105.l0VB5Hhj020002>