From owner-p4-projects@FreeBSD.ORG Mon Jun 15 12:14:26 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4D69E1065674; Mon, 15 Jun 2009 12:14:26 +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 0D748106564A for ; Mon, 15 Jun 2009 12:14:26 +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 D61508FC12 for ; Mon, 15 Jun 2009 12:14:25 +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 n5FCEPxf086301 for ; Mon, 15 Jun 2009 12:14:25 GMT (envelope-from zhaoshuai@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5FCEPDX086299 for perforce@freebsd.org; Mon, 15 Jun 2009 12:14:25 GMT (envelope-from zhaoshuai@FreeBSD.org) Date: Mon, 15 Jun 2009 12:14:25 GMT Message-Id: <200906151214.n5FCEPDX086299@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 164419 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: Mon, 15 Jun 2009 12:14:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=164419 Change 164419 by zhaoshuai@zhaoshuai on 2009/06/15 12:14:15 -format pr_116770.c -add a header file in pr_76525.c to remove compile warnings Affected files ... .. //depot/projects/soc2009/fifo/fifo_test/functionality/pr_116770.c#2 edit .. //depot/projects/soc2009/fifo/fifo_test/functionality/pr_76525.c#3 edit Differences ... ==== //depot/projects/soc2009/fifo/fifo_test/functionality/pr_116770.c#2 (text+ko) ==== @@ -21,59 +21,59 @@ int main(void) { - int rfd,wfd,qfd,n; + int rfd, wfd, qfd, n; static struct timespec zero; struct kevent kev; char fifopath[64]; sprintf(fifopath,"/tmp/less-than-useful.%ld",(long)getpid()); - if (mkfifo(fifopath,S_IRUSR|S_IWUSR)==-1) { + if (mkfifo(fifopath, S_IRUSR | S_IWUSR) == -1) { perror("mkfifo"); return 1; } - rfd=open(fifopath,O_RDONLY|O_NONBLOCK); - if (rfd==-1) { + rfd = open(fifopath, O_RDONLY | O_NONBLOCK); + if (rfd == -1) { perror("open 1"); goto cleanup; } - qfd=kqueue(); - if (qfd==-1) { + qfd = kqueue(); + if (qfd == -1) { perror("kqueue"); goto cleanup; } - EV_SET(&kev,rfd,EVFILT_READ,EV_ADD,0,0,NULL); - n=kevent(qfd,&kev,1,NULL,0,&zero); - if (n==-1) { + EV_SET(&kev, rfd, EVFILT_READ, EV_ADD, 0, 0, NULL); + n = kevent(qfd, &kev, 1, NULL, 0, &zero); + if (n == -1) { perror("kevent 1"); goto cleanup; } - n=kevent(qfd,NULL,0,&kev,1,&zero); - if (n==-1) { + n = kevent(qfd, NULL, 0, &kev, 1, &zero); + if (n == -1) { perror("kevent 2"); goto cleanup; } - if (n==1 && (kev.flags & EV_EOF)) { + if (n == 1 && (kev.flags & EV_EOF)) { fputs("Immediate EOF (not useful)\n",stderr); } - wfd=open(fifopath,O_WRONLY); - if (wfd==-1) { + wfd = open(fifopath, O_WRONLY); + if (wfd == -1) { perror("open 2"); goto cleanup; } - n=kevent(qfd,NULL,0,&kev,1,&zero); - if (n==-1) { + n = kevent(qfd, NULL, 0, &kev, 1, &zero); + if (n == -1) { perror("kevent 3"); goto cleanup; } - if (n==1 && (kev.flags & EV_EOF)) { + if (n == 1 && (kev.flags & EV_EOF)) { fputs("EOF while there's still a writer (BUG!)\n",stderr); } close(wfd); - n=kevent(qfd,NULL,0,&kev,1,&zero); - if (n==-1) { + n = kevent(qfd, NULL, 0, &kev, 1, &zero); + if (n == -1) { perror("kevent 4"); goto cleanup; } ==== //depot/projects/soc2009/fifo/fifo_test/functionality/pr_76525.c#3 (text+ko) ==== @@ -142,6 +142,7 @@ */ #include +#include #include #include #include