Changeset c657bd7 in mainline for uspace/drv/hid/xtkbd/xtkbd.c


Ignore:
Timestamp:
2017-11-20T10:06:59Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
19ea61d
Parents:
5d50c419
git-author:
Jiri Svoboda <jiri@…> (2017-11-19 22:05:26)
git-committer:
Jiri Svoboda <jiri@…> (2017-11-20 10:06:59)
Message:

Less is sometimes more. Need chardev_read to be able to return less bytes than requested if less is available. Otherwise cannot read variable-sized packets except yte-by-byte.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/hid/xtkbd/xtkbd.c

    r5d50c419 rc657bd7  
    353353               
    354354                size_t nwr;
    355                 int rc = chardev_write(kbd->chardev, cmds, sizeof(cmds), &nwr);
    356                 if (nwr != sizeof(cmds))
    357                         rc = EIO;
    358 
     355                int rc = chardev_write(kbd->chardev, &cmds[0], 1, &nwr);
     356                if (rc != EOK) {
     357                        async_answer_0(icallid, rc);
     358                        break;
     359                }
     360
     361                rc = chardev_write(kbd->chardev, &cmds[1], 1, &nwr);
    359362                async_answer_0(icallid, rc);
    360363                break;
Note: See TracChangeset for help on using the changeset viewer.