From: Andreas Schneider Date: Wed, 16 Jul 2008 10:05:52 +0000 (+0200) Subject: The buf in the smbclient write function should be const. X-Git-Tag: samba-4.0.0alpha6~801^2~686 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43892abff68054928312fd54e50d5bdebe604b63;p=thirdparty%2Fsamba.git The buf in the smbclient write function should be const. As we try to provide POSIX function, we should use const like all other POSIX function. Signed-off-by: Andreas Schneider Signed-off-by: Derrell Lipman (This used to be commit 36e5df59544de9df140ca40ad0efd77afd8e1468) --- diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 6930812b29a..3b909d13b95 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -346,7 +346,7 @@ SMBC_read_ctx(SMBCCTX *context, ssize_t SMBC_write_ctx(SMBCCTX *context, SMBCFILE *file, - void *buf, + const void *buf, size_t count); int diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 5fe4fa8c60b..a8b27b709e4 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -796,7 +796,7 @@ void smbc_setFunctionRead(SMBCCTX *c, smbc_read_fn fn); typedef ssize_t (*smbc_write_fn)(SMBCCTX *c, SMBCFILE *file, - void *buf, + const void *buf, size_t count); smbc_write_fn smbc_getFunctionWrite(SMBCCTX *c); void smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn); @@ -1240,7 +1240,7 @@ ssize_t smbc_read(int fd, void *buf, size_t bufsize); * @see smbc_open(), smbc_read() * */ -ssize_t smbc_write(int fd, void *buf, size_t bufsize); +ssize_t smbc_write(int fd, const void *buf, size_t bufsize); /**@ingroup file diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index 423450b23ee..7b287096c21 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -329,7 +329,7 @@ SMBC_read_ctx(SMBCCTX *context, ssize_t SMBC_write_ctx(SMBCCTX *context, SMBCFILE *file, - void *buf, + const void *buf, size_t count) { int ret;