This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4][BZ #12685] Allow arbitrary number of modes in fopen.
- From: Andreas Schwab <schwab at suse dot de>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Carlos O'Donell <carlos at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Tue, 21 May 2013 09:31:39 +0200
- Subject: Re: [PATCH v4][BZ #12685] Allow arbitrary number of modes in fopen.
- References: <Pine dot LNX dot 4 dot 64 dot 1305091533180 dot 25142 at digraph dot polyomino dot org dot uk> <518BEFB2 dot 80304 at redhat dot com> <20130510103330 dot GA12338 at domone dot kolej dot mff dot cuni dot cz> <Pine dot LNX dot 4 dot 64 dot 1305101139470 dot 1189 at digraph dot polyomino dot org dot uk> <20130514121540 dot GA28892 at domone dot kolej dot mff dot cuni dot cz> <mvm38tpzqst dot fsf at hawking dot suse dot de> <20130514124257 dot GB18821 at domone dot kolej dot mff dot cuni dot cz> <mvmy5bhyb4h dot fsf at hawking dot suse dot de> <20130515091735 dot GA22641 at domone dot kolej dot mff dot cuni dot cz> <5193F463 dot 3040501 at redhat dot com> <20130520081258 dot GA32195 at domone dot kolej dot mff dot cuni dot cz>
OndÅej BÃlka <neleai@seznam.cz> writes:
> diff --git a/libio/Makefile b/libio/Makefile
> index e15cd40..8892305 100644
> --- a/libio/Makefile
> +++ b/libio/Makefile
> @@ -54,7 +54,7 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
> tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof \
> tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \
> tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
> - tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
> + tst-mmap2-eofsync tst-mmap-offend test-fopen-bz12685 bug-fopena+ bug-wfflush \
Overlong line.
> +int
> +do_test (int argc, char *argv)
> +{
> + int i;
> + FILE *stream, *stream2;
> +
> + /* Test if fopen mode e that sets FD_CLOEXEC is recognized. */
> + stream = fopen ("/dev/null", "rccccccccccccccccccccce");
> +
> + if ((fcntl (fileno (stream), F_GETFD) & FD_CLOEXEC) == 0)
> + {
> + printf("no FD_CLOEXEC on fopen\n");
> + return 1;
> + }
> + /* In fdopen e flag is ignored. */
Odd indentation.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."