Date: Sat, 13 Jun 2009 08:12:39 GMT From: Zhao Shuai <zhaoshuai@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 164244 for review Message-ID: <200906130812.n5D8CdiK058980@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906130812.n5D8CdiK058980>