Changeset 19b3cc6 in mainline for uspace/lib/c/generic/io/io.c


Ignore:
Timestamp:
2014-01-17T23:12:10Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e26a9d95
Parents:
fddffb2 (diff), facc34d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libdrv-cleanup branch (includes mainline changes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/io/io.c

    rfddffb2 r19b3cc6  
    4242#include <malloc.h>
    4343#include <async.h>
    44 #include <io/klog.h>
     44#include <io/kio.h>
    4545#include <vfs/vfs.h>
    4646#include <vfs/vfs_sess.h>
     
    5757        .error = true,
    5858        .eof = true,
    59         .klog = false,
     59        .kio = false,
    6060        .sess = NULL,
    6161        .btype = _IONBF,
     
    6767};
    6868
    69 static FILE stdout_klog = {
     69static FILE stdout_kio = {
    7070        .fd = -1,
    7171        .error = false,
    7272        .eof = false,
    73         .klog = true,
     73        .kio = true,
    7474        .sess = NULL,
    7575        .btype = _IOLBF,
     
    8181};
    8282
    83 static FILE stderr_klog = {
     83static FILE stderr_kio = {
    8484        .fd = -1,
    8585        .error = false,
    8686        .eof = false,
    87         .klog = true,
     87        .kio = true,
    8888        .sess = NULL,
    8989        .btype = _IONBF,
     
    113113                stdout = fdopen(1, "w");
    114114        } else {
    115                 stdout = &stdout_klog;
     115                stdout = &stdout_kio;
    116116                list_append(&stdout->link, &files);
    117117        }
     
    120120                stderr = fdopen(2, "w");
    121121        } else {
    122                 stderr = &stderr_klog;
     122                stderr = &stderr_kio;
    123123                list_append(&stderr->link, &files);
    124124        }
     
    267267        stream->error = false;
    268268        stream->eof = false;
    269         stream->klog = false;
     269        stream->kio = false;
    270270        stream->sess = NULL;
    271271        stream->need_sync = false;
     
    289289        stream->error = false;
    290290        stream->eof = false;
    291         stream->klog = false;
     291        stream->kio = false;
    292292        stream->sess = NULL;
    293293        stream->need_sync = false;
     
    314314       
    315315        if ((stream != &stdin_null)
    316             && (stream != &stdout_klog)
    317             && (stream != &stderr_klog))
     316            && (stream != &stdout_kio)
     317            && (stream != &stderr_kio))
    318318                free(stream);
    319319       
     
    382382                ssize_t wr;
    383383               
    384                 if (stream->klog)
    385                         wr = klog_write(buf + done, left);
     384                if (stream->kio)
     385                        wr = kio_write(buf + done, left);
    386386                else
    387387                        wr = write(stream->fd, buf + done, left);
     
    705705        _fflushbuf(stream);
    706706       
    707         if (stream->klog) {
    708                 klog_update();
     707        if (stream->kio) {
     708                kio_update();
    709709                return EOK;
    710710        }
     
    740740int fileno(FILE *stream)
    741741{
    742         if (stream->klog) {
     742        if (stream->kio) {
    743743                errno = EBADF;
    744744                return -1;
Note: See TracChangeset for help on using the changeset viewer.