diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2018-02-23 20:18:09 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2018-02-23 20:18:09 +0000 |
commit | 2e7e6fbce568e53b422f3b82d8e56cfe7ecc5a7b (patch) | |
tree | 3b6de142d4c6042b1fde726865789fb43e6df0a1 /stand/libsa/ufs.c | |
parent | 849ce31a82eb6cd30968a145000e554d7f7a30d0 (diff) | |
download | src-2e7e6fbce568e53b422f3b82d8e56cfe7ecc5a7b.tar.gz src-2e7e6fbce568e53b422f3b82d8e56cfe7ecc5a7b.zip |
libsa: Const-ify buffer argument of write(2) analog
Reported by: kevans
Reviewed by: delphij, eadler, imp, kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14482
Notes
Notes:
svn path=/head/; revision=329879
Diffstat (limited to 'stand/libsa/ufs.c')
-rw-r--r-- | stand/libsa/ufs.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stand/libsa/ufs.c b/stand/libsa/ufs.c index 786cbb80f1d5..3f0d85be13c5 100644 --- a/stand/libsa/ufs.c +++ b/stand/libsa/ufs.c @@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$"); #include "string.h" static int ufs_open(const char *path, struct open_file *f); -static int ufs_write(struct open_file *f, void *buf, size_t size, size_t *resid); +static int ufs_write(struct open_file *f, const void *buf, size_t size, + size_t *resid); static int ufs_close(struct open_file *f); static int ufs_read(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t ufs_seek(struct open_file *f, off_t offset, int where); @@ -131,7 +132,7 @@ struct file { static int read_inode(ino_t, struct open_file *); static int block_map(struct open_file *, ufs2_daddr_t, ufs2_daddr_t *); static int buf_read_file(struct open_file *, char **, size_t *); -static int buf_write_file(struct open_file *, char *, size_t *); +static int buf_write_file(struct open_file *, const char *, size_t *); static int search_directory(char *, struct open_file *, ino_t *); static int ufs_use_sa_read(void *, off_t, void **, int); @@ -306,7 +307,7 @@ block_map(f, file_block, disk_block_p) static int buf_write_file(f, buf_p, size_p) struct open_file *f; - char *buf_p; + const char *buf_p; size_t *size_p; /* out */ { struct file *fp = (struct file *)f->f_fsdata; @@ -770,14 +771,14 @@ ufs_read(f, start, size, resid) static int ufs_write(f, start, size, resid) struct open_file *f; - void *start; + const void *start; size_t size; size_t *resid; /* out */ { struct file *fp = (struct file *)f->f_fsdata; size_t csize; int rc = 0; - char *addr = start; + const char *addr = start; csize = size; while ((size != 0) && (csize != 0)) { |