diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-07 15:10:20 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-10 09:53:31 +0100 |
commit | c40e45b75eb76d79a05c7fa85c1fa9b5c728a12f (patch) | |
tree | ad4f2519067709f00ab98b3c591186c26dc3a21f /rtemsbsd/sys/fs/devfs/devfs_devs.c | |
parent | userspace-header-gen.py: Simplify program ports (diff) | |
download | rtems-libbsd-c40e45b75eb76d79a05c7fa85c1fa9b5c728a12f.tar.bz2 |
Update to FreeBSD head 2016-08-23
Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.
Diffstat (limited to 'rtemsbsd/sys/fs/devfs/devfs_devs.c')
-rwxr-xr-x | rtemsbsd/sys/fs/devfs/devfs_devs.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/rtemsbsd/sys/fs/devfs/devfs_devs.c b/rtemsbsd/sys/fs/devfs/devfs_devs.c index 75c9e270..85929e81 100755 --- a/rtemsbsd/sys/fs/devfs/devfs_devs.c +++ b/rtemsbsd/sys/fs/devfs/devfs_devs.c @@ -98,7 +98,7 @@ devfs_imfs_readv(rtems_libio_t *iop, const struct iovec *iov, int iovcnt, struct cdev *cdev = devfs_imfs_get_context_by_iop(iop); struct thread *td = rtems_bsd_get_curthread_or_null(); struct uio uio = { - .uio_iov = iov, + .uio_iov = __DECONST(struct iovec *, iov), .uio_iovcnt = iovcnt, .uio_offset = 0, .uio_resid = total, @@ -140,7 +140,7 @@ devfs_imfs_writev(rtems_libio_t *iop, const struct iovec *iov, int iovcnt, struct cdev *cdev = devfs_imfs_get_context_by_iop(iop); struct thread *td = rtems_bsd_get_curthread_or_null(); struct uio uio = { - .uio_iov = iov, + .uio_iov = __DECONST(struct iovec *, iov), .uio_iovcnt = iovcnt, .uio_offset = 0, .uio_resid = total, @@ -168,7 +168,7 @@ static ssize_t devfs_imfs_write(rtems_libio_t *iop, const void *buffer, size_t count) { struct iovec iov = { - .iov_base = buffer, + .iov_base = __DECONST(void *, buffer), .iov_len = count }; @@ -237,15 +237,11 @@ devfs_alloc(int flags) { struct cdev *cdev; - cdev = malloc(sizeof *cdev, M_TEMP, 0); - if (cdev == NULL) + cdev = malloc(sizeof *cdev, M_TEMP, M_ZERO); + if (cdev != NULL) return (NULL); - memset(cdev, 0, sizeof *cdev); - cdev->si_name = cdev->__si_namebuf; - memcpy(cdev->__si_pathstruct.__si_dir, rtems_cdev_directory, - sizeof(rtems_cdev_directory) - 1); - + memcpy(cdev->si_path, rtems_cdev_directory, sizeof(cdev->si_path)); return (cdev); } |