From owner-freebsd-hackers@FreeBSD.ORG Wed May 26 06:34:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FF3816A4CE for ; Wed, 26 May 2004 06:34:22 -0700 (PDT) Received: from purge.bash.sh (purge.bash.sh [193.178.223.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3E3743D46 for ; Wed, 26 May 2004 06:34:21 -0700 (PDT) (envelope-from stu@ipng.org.uk) Received: from [212.111.132.131] (helo=swalsh) by purge.bash.sh with asmtp (Exim 4.30 #1 ) id 1BSyXf-0000d8-OL; Wed, 26 May 2004 14:34:00 +0100 Message-ID: <007c01c44326$18beeb40$390310ac@swalsh> From: "Stuart Walsh" To: "Anton Alin-Adrian" , References: <40AF7F5A.1080500@reversedhell.net> Date: Wed, 26 May 2004 14:33:03 +0100 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-SA-Exim-Mail-From: stu@ipng.org.uk Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on purge.bash.sh X-Spam-Level: X-Spam-Status: No, hits=0.1 required=5.0 tests=AWL autolearn=no version=2.61 X-SA-Exim-Version: 3.1 (built Sat Dec 20 09:59:50 GMT 2003) X-SA-Exim-Scanned: Yes Subject: Re: fopen("file","a") X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2004 13:34:22 -0000 ----- Original Message ----- From: "Anton Alin-Adrian" To: Sent: Saturday, May 22, 2004 5:27 PM Subject: fopen("file","a") > Hey folks. > > Running FreeBSD 4.9-RELEASE > > I am just wondering: > > man fopen > ---man--- > Upon successful completion fopen(), fdopen() and freopen() return a > FILE pointer. Otherwise, NULL is returned and the global variable errno is > set to indicate the error. > ---man--- > > > However, the following snippet: > > --snip-- > FILE *fp_queue; > > if ( (fp_queue=fopen(fqueue,"a")) ==NULL);//will wait for locks > { > perror("fopen(fqueue,\"a\")"); > //exit(EXIT_FAILURE); > } > --snip-- > > You have a semicolon after your if... looks like a typo, but that will mean the perror always gets called. Regards, Stuart