[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tyndur-devel] [PATCH] libc: fopen-Modus "a+" gefixt
On 26.09.2011 15:02, Kevin Wolf wrote:
> ! libc: Der fopen-Modus "a+" muss die Datei auch zum Lesen öffnen
>
> Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
> ---
> src/modules/lib/stdlibc/file.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/src/modules/lib/stdlibc/file.c b/src/modules/lib/stdlibc/file.c
> index 559920f..89b95e6 100644
> --- a/src/modules/lib/stdlibc/file.c
> +++ b/src/modules/lib/stdlibc/file.c
> @@ -87,6 +87,9 @@ FILE* fopen (const char* filename, const char* mode)
> case 'a':
> attr |= IO_OPEN_MODE_WRITE | IO_OPEN_MODE_CREATE
> | IO_OPEN_MODE_APPEND;
> + if (mode[i + 1] == '+') {
> + attr |= IO_OPEN_MODE_READ;
> + }
> break;
>
> case 'd':
Acked-by: Andreas Freimuth <m.nemo@xxxxxxx>
--
MNemo