From owner-p4-projects@FreeBSD.ORG Sat Jun 13 08:12:40 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1B7231065674; Sat, 13 Jun 2009 08:12:40 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE4591065670 for ; Sat, 13 Jun 2009 08:12:39 +0000 (UTC) (envelope-from zhaoshuai@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BC0CD8FC0C for ; Sat, 13 Jun 2009 08:12:39 +0000 (UTC) (envelope-from zhaoshuai@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5D8CdQ0058982 for ; Sat, 13 Jun 2009 08:12:39 GMT (envelope-from zhaoshuai@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5D8CdiK058980 for perforce@freebsd.org; Sat, 13 Jun 2009 08:12:39 GMT (envelope-from zhaoshuai@FreeBSD.org) Date: Sat, 13 Jun 2009 08:12:39 GMT Message-Id: <200906130812.n5D8CdiK058980@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zhaoshuai@FreeBSD.org using -f From: Zhao Shuai To: Perforce Change Reviews Cc: Subject: PERFORCE change 164244 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2009 08:12:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=164244 Change 164244 by zhaoshuai@zhaoshuai on 2009/06/13 08:12:25 a little modification on reader1.c and writer1.c Affected files ... .. //depot/projects/soc2009/fifo/fifo_test/functionality/reader1.c#2 edit .. //depot/projects/soc2009/fifo/fifo_test/functionality/writer1.c#2 edit Differences ... ==== //depot/projects/soc2009/fifo/fifo_test/functionality/reader1.c#2 (text+ko) ==== @@ -17,11 +17,11 @@ int fd, n; char buffer[BUF_SIZE]; + fd = open(FIFO_PATH, O_RDONLY); /* - fd = open(FIFO_PATH, O_RDONLY); fd = open(FIFO_PATH, O_RDWR); + fd = open(FIFO_PATH, O_RDONLY | O_NONBLOCK); */ - fd = open(FIFO_PATH, O_RDONLY | O_NONBLOCK); if (fd < 0) { perror("open error"); return (1); ==== //depot/projects/soc2009/fifo/fifo_test/functionality/writer1.c#2 (text+ko) ==== @@ -16,14 +16,14 @@ int main(int argc, char *argv[]) { int fd, n; - char buf[4096]; + char buf[BUF_SIZE]; - fd = open(FIFO_PATH, O_WRONLY | O_NONBLOCK); + fd = open(FIFO_PATH, O_WRONLY); /* - fd = open(FIFO_PATH, O_WRONLY); fd = open(FIFO_PATH, O_RDWR); + fd = open(FIFO_PATH, O_WRONLY | O_NONBLOCK); */ - while ((n = read(0, buf, 4096)) > 0) + while ((n = read(0, buf, BUF_SIZE)) > 0) write(fd, buf, n); return 0;