PERFORCE change 165534 for review

Zhao Shuai zhaoshuai at FreeBSD.org
Thu Jul 2 09:12:30 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=165534

Change 165534 by zhaoshuai at zhaoshuai on 2009/07/02 09:12:20

	don't poll/select on a closed file descriptor.

Affected files ...

.. //depot/projects/soc2009/fifo/fifo_test/regression/fifo_io/fifo_io.c#3 edit

Differences ...

==== //depot/projects/soc2009/fifo/fifo_test/regression/fifo_io/fifo_io.c#3 (text+ko) ====

@@ -1416,22 +1416,13 @@
 	}
 
 	/* 
-	 * close the reader, which should cause 
-	 * - reader_fd unreadable, unwritable, not exceptional
-	 * - writer_fd unreadable, unwritable, not exceptional
+	 * close the reader, which should cause writer_fd unreadable, 
+	 * writable, not exceptional
 	 */
 	close(reader_fd);
 
-	/*
-	if (assert_status(reader_fd, kqueue_fd, NOT_READABLE, NOT_WRITABLE,
-	    NOT_EXCEPTION, __func__, "close_reader", "reader_fd") < 0) {
-		cleanfifo2("testfifo", writer_fd, kqueue_fd);
-		exit(-1);
-	}
-	*/
-
-	if (assert_status(writer_fd, kqueue_fd, READABLE, WRITABLE,
-	    EXCEPTION, __func__, "close_reader", "writer_fd") < 0) {
+	if (assert_status(writer_fd, kqueue_fd, NOT_READABLE, WRITABLE,
+	    NOT_EXCEPTION, __func__, "close_reader", "writer_fd") < 0) {
 		cleanfifo2("testfifo", writer_fd, kqueue_fd);
 		exit(-1);
 	}
@@ -1473,26 +1464,17 @@
 	}
 
 	/* 
-	 * close the writer, which should cause 
-	 * - reader_fd readable, unwritable, exceptional
-	 * - writer_fd unreadable, unwritable, not exceptional
+	 * close the writer, which should cause reader_fd readable, 
+	 * unwritable, not exceptional
 	 */
 	close(writer_fd);
 
-	if (assert_status(reader_fd, kqueue_fd, NOT_READABLE, NOT_WRITABLE,
+	if (assert_status(reader_fd, kqueue_fd, READABLE, NOT_WRITABLE,
 	    NOT_EXCEPTION, __func__, "close_writer", "reader_fd") < 0) {
 		cleanfifo2("testfifo", reader_fd, kqueue_fd);
 		exit(-1);
 	}
 
-	/*
-	if (assert_status(writer_fd, kqueue_fd, NOT_READABLE, NOT_WRITABLE,
-	    NOT_EXCEPTION, __func__, "close_writer", "writer_fd") < 0) {
-		cleanfifo2("testfifo", reader_fd, kqueue_fd);
-		exit(-1);
-	}
-	*/
-
 	cleanfifo2("testfifo", reader_fd, kqueue_fd);
 }
 


More information about the p4-projects mailing list