Changeset 4f4b4e7 in mainline for uspace/lib/posix/stdio.c


Ignore:
Timestamp:
2011-06-15T23:38:45Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b08ef1fd
Parents:
ab547063
Message:

Coding style and file structure unified.
_exit moved to unistd.h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/stdio.c

    rab547063 r4f4b4e7  
    11/*
    22 * Copyright (c) 2011 Jiri Zarevucky
     3 * Copyright (c) 2011 Petr Koupy
    34 * All rights reserved.
    45 *
     
    3637
    3738#include <assert.h>
    38 #include "errno.h"
     39#include <errno.h>
     40
    3941#include "common.h"
    4042#include "stdio.h"
    4143#include "string.h"
     44
    4245/* not the best of solutions, but freopen will eventually
    43    need to be implemented in libc anyway */
     46 * need to be implemented in libc anyway
     47 */
    4448#include "../c/generic/private/stdio.h"
    4549
    46 FILE *posix_freopen(const char *restrict filename,
    47                     const char *restrict mode,
    48                     FILE *restrict stream)
     50/**
     51 *
     52 * @param filename
     53 * @param mode
     54 * @param stream
     55 * @return
     56 */
     57FILE *posix_freopen(
     58    const char *restrict filename,
     59    const char *restrict mode,
     60    FILE *restrict stream)
    4961{
    5062        assert(mode != NULL);
     
    5567               
    5668                /* print error to stderr as well, to avoid hard to find problems
    57                    with buggy apps that expect this to work */
    58                 fprintf(stderr, "ERROR: Application wants to use freopen() to change mode of opened stream.\n"
    59                                 "       libposix does not support that yet, the application may function improperly.\n");
     69                 * with buggy apps that expect this to work
     70                 */
     71                fprintf(stderr,
     72                    "ERROR: Application wants to use freopen() to change mode of opened stream.\n"
     73                    "       libposix does not support that yet, the application may function improperly.\n");
    6074                errno = ENOTSUP;
    6175                return NULL;
     
    6882        }
    6983        memcpy(copy, stream, sizeof(FILE));
    70         fclose(copy);   /* copy is now freed */
     84        fclose(copy); /* copy is now freed */
    7185       
    72         copy = fopen(filename, mode);         /* open new stream */
     86        copy = fopen(filename, mode); /* open new stream */
    7387        if (copy == NULL) {
    7488                /* fopen() sets errno */
     
    87101}
    88102
     103/**
     104 *
     105 * @param s
     106 */
    89107void posix_perror(const char *s)
    90108{
     
    95113/** @}
    96114 */
    97 
Note: See TracChangeset for help on using the changeset viewer.