Changeset 132ab5d1 in mainline for uspace/srv/hid/console/console.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (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 commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/console/console.c

    r8bfb163 r132ab5d1  
    4747#include <io/output.h>
    4848#include <align.h>
    49 #include <malloc.h>
    5049#include <as.h>
    5150#include <task.h>
    5251#include <fibril_synch.h>
     52#include <stdlib.h>
    5353#include "console.h"
    5454
     
    119119static int cons_open(con_srvs_t *, con_srv_t *);
    120120static int cons_close(con_srv_t *);
    121 static int cons_read(con_srv_t *, void *, size_t);
    122 static int cons_write(con_srv_t *, void *, size_t);
     121static int cons_read(con_srv_t *, void *, size_t, size_t *);
     122static int cons_write(con_srv_t *, void *, size_t, size_t *);
    123123static void cons_sync(con_srv_t *);
    124124static void cons_clear(con_srv_t *);
     
    338338}
    339339
    340 static int cons_read(con_srv_t *srv, void *buf, size_t size)
     340static int cons_read(con_srv_t *srv, void *buf, size_t size, size_t *nread)
    341341{
    342342        uint8_t *bbuf = buf;
     
    378378        }
    379379       
    380         return size;
    381 }
    382 
    383 static int cons_write(con_srv_t *srv, void *data, size_t size)
     380        *nread = size;
     381        return EOK;
     382}
     383
     384static int cons_write(con_srv_t *srv, void *data, size_t size, size_t *nwritten)
    384385{
    385386        console_t *cons = srv_to_console(srv);
     
    389390                cons_write_char(cons, str_decode(data, &off, size));
    390391       
    391         return size;
     392        *nwritten = size;
     393        return EOK;
    392394}
    393395
Note: See TracChangeset for help on using the changeset viewer.