Re: problem opening multiple pipes with pipe(2) in 2.4.1[78]

Ulrich Drepper (drepper@redhat.com)
Mon, 21 Oct 2002 19:16:55 -0700


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sean finney wrote:

>
> int main(){
> int p1[2], p2[2];
> pipe(p1);
> perror("p1");
> pipe(p2);
> perror("p2");
> return 0;
> }

The fault is entirely yours. You're not allowed to look at errno unless
a function, which is defined to modify error on failure, is reporting it
failed. Both pipe() calls work just fine and errno has some random
value which happens to be ESPIPE for you. Read the standard.

- --
- --------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9tLUX2ijCOnn/RHQRAsAvAJoCBHjJY+Fw8ngfW2HeH8i1ozMenwCdH/Zd
49t/9uthYez2yYk4JoYgbrU=
=Ijan
-----END PGP SIGNATURE-----

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/