PERFORCE change 164244 for review
Zhao Shuai
zhaoshuai at FreeBSD.org
Sat Jun 13 08:12:41 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=164244
Change 164244 by zhaoshuai at 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;
More information about the p4-projects
mailing list