Re: fopen("file","a")
From: Stuart Walsh (stu_at_ipng.org.uk)
Date: 05/26/04
- Previous message: David Malone: "Re: fopen("file","a")"
- In reply to: Anton Alin-Adrian: "fopen("file","a")"
- Next in thread: Dag-Erling Smørgrav: "Re: fopen("file","a")"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: "Anton Alin-Adrian" <aanton@reversedhell.net>, <freebsd-hackers@freebsd.org> Date: Wed, 26 May 2004 14:33:03 +0100
----- Original Message -----
From: "Anton Alin-Adrian" <aanton@reversedhell.net>
To: <freebsd-hackers@freebsd.org>
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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: David Malone: "Re: fopen("file","a")"
- In reply to: Anton Alin-Adrian: "fopen("file","a")"
- Next in thread: Dag-Erling Smørgrav: "Re: fopen("file","a")"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]