aboutsummaryrefslogtreecommitdiff
path: root/trans
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-17 00:32:29 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-17 00:43:09 +0100
commitf5fb7c713ea443469406a691e60a6f4567a4cb75 (patch)
treeb16d979915b5ad7e32ffe77ca5f5006dc639a16e /trans
parentdd3048b2e483f66571cfa1b2ccebb2091b9ad990 (diff)
downloadhurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.gz
hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.tar.bz2
hurd-f5fb7c713ea443469406a691e60a6f4567a4cb75.zip
Fix const warnings
Now that the RPCs have const, this forces us cleaning our const-meant functions.
Diffstat (limited to 'trans')
-rw-r--r--trans/fakeroot.c22
-rw-r--r--trans/firmlink.c2
-rw-r--r--trans/magic.c2
-rw-r--r--trans/streamio.c8
4 files changed, 17 insertions, 17 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index c43a1c00..944fafdb 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -517,7 +517,7 @@ netfs_S_dir_lookup (struct protid *diruser,
CRED. */
error_t
netfs_set_translator (struct iouser *cred, struct node *np,
- char *argz, size_t argzlen)
+ const char *argz, size_t argzlen)
{
return file_set_translator (netfs_node_netnode (np)->file,
FS_TRANS_EXCL|FS_TRANS_SET,
@@ -530,7 +530,7 @@ netfs_set_translator (struct iouser *cred, struct node *np,
which we do not use. But the shared library requires us to define them. */
error_t
netfs_attempt_lookup (struct iouser *user, struct node *dir,
- char *name, struct node **np)
+ const char *name, struct node **np)
{
assert_backtrace (! "should not be here");
return EIEIO;
@@ -538,7 +538,7 @@ netfs_attempt_lookup (struct iouser *user, struct node *dir,
error_t
netfs_attempt_create_file (struct iouser *user, struct node *dir,
- char *name, mode_t mode, struct node **np)
+ const char *name, mode_t mode, struct node **np)
{
assert_backtrace (! "should not be here");
return EIEIO;
@@ -640,7 +640,7 @@ netfs_attempt_chmod (struct iouser *cred, struct node *np, mode_t mode)
/* The user must define this function. Attempt to turn locked node NP
(user CRED) into a symlink with target NAME. */
error_t
-netfs_attempt_mksymlink (struct iouser *cred, struct node *np, char *name)
+netfs_attempt_mksymlink (struct iouser *cred, struct node *np, const char *name)
{
int namelen = strlen (name) + 1;
char trans[sizeof _HURD_SYMLINK + namelen];
@@ -755,7 +755,7 @@ netfs_attempt_syncfs (struct iouser *cred, int wait)
error_t
netfs_attempt_mkdir (struct iouser *user, struct node *dir,
- char *name, mode_t mode)
+ const char *name, mode_t mode)
{
return dir_mkdir (netfs_node_netnode (dir)->file, name, mode | S_IRWXU);
}
@@ -767,15 +767,15 @@ netfs_attempt_mkdir (struct iouser *user, struct node *dir,
*/
error_t
-netfs_attempt_unlink (struct iouser *user, struct node *dir, char *name)
+netfs_attempt_unlink (struct iouser *user, struct node *dir, const char *name)
{
return dir_unlink (netfs_node_netnode (dir)->file, name);
}
error_t
netfs_attempt_rename (struct iouser *user, struct node *fromdir,
- char *fromname, struct node *todir,
- char *toname, int excl)
+ const char *fromname, struct node *todir,
+ const char *toname, int excl)
{
return dir_rename (netfs_node_netnode (fromdir)->file, fromname,
netfs_node_netnode (todir)->file, toname, excl);
@@ -783,14 +783,14 @@ netfs_attempt_rename (struct iouser *user, struct node *fromdir,
error_t
netfs_attempt_rmdir (struct iouser *user,
- struct node *dir, char *name)
+ struct node *dir, const char *name)
{
return dir_rmdir (netfs_node_netnode (dir)->file, name);
}
error_t
netfs_attempt_link (struct iouser *user, struct node *dir,
- struct node *file, char *name, int excl)
+ struct node *file, const char *name, int excl)
{
return dir_link (netfs_node_netnode (dir)->file, netfs_node_netnode (file)->file, name, excl);
}
@@ -861,7 +861,7 @@ netfs_attempt_read (struct iouser *cred, struct node *np,
error_t
netfs_attempt_write (struct iouser *cred, struct node *np,
- off_t offset, size_t *len, void *data)
+ off_t offset, size_t *len, const void *data)
{
return io_write (netfs_node_netnode (np)->file, data, *len, offset, len);
}
diff --git a/trans/firmlink.c b/trans/firmlink.c
index dba5e4ef..8a5d01a8 100644
--- a/trans/firmlink.c
+++ b/trans/firmlink.c
@@ -140,7 +140,7 @@ static error_t
getroot (struct trivfs_control *cntl,
mach_port_t reply_port, mach_msg_type_name_t reply_port_type,
mach_port_t dotdot,
- uid_t *uids, u_int nuids, uid_t *gids, u_int ngids,
+ const uid_t *uids, u_int nuids, const uid_t *gids, u_int ngids,
int flags,
retry_type *do_retry, char *retry_name,
mach_port_t *node, mach_msg_type_name_t *node_type)
diff --git a/trans/magic.c b/trans/magic.c
index bc23e719..4e534e7a 100644
--- a/trans/magic.c
+++ b/trans/magic.c
@@ -150,7 +150,7 @@ magic_getroot (struct trivfs_control *cntl,
mach_port_t reply_port,
mach_msg_type_name_t reply_port_type,
mach_port_t dotdot,
- uid_t *uids, u_int nuids, uid_t *gids, u_int ngids,
+ const uid_t *uids, u_int nuids, const uid_t *gids, u_int ngids,
int flags,
retry_type *do_retry, char *retry_name,
mach_port_t *node, mach_msg_type_name_t *node_type)
diff --git a/trans/streamio.c b/trans/streamio.c
index 566f0aa5..30b8b20e 100644
--- a/trans/streamio.c
+++ b/trans/streamio.c
@@ -143,7 +143,7 @@ buffer_read (struct buffer *b, void *data, size_t len)
/* Write LEN bytes from DATA to B, returning the amount actually written. */
static inline size_t
-buffer_write (struct buffer *b, void *data, size_t len)
+buffer_write (struct buffer *b, const void *data, size_t len)
{
size_t size = buffer_writable (b);
@@ -182,7 +182,7 @@ error_t dev_readable (size_t *amount);
in AMOUNT. If NOWAIT is non-zero and the buffer is full, then returns
EWOULDBLOCK. If an error occurs, the error code is returned,
otherwise 0. */
-error_t dev_write (void *buf, size_t len, size_t *amount, int nowait);
+error_t dev_write (const void *buf, size_t len, size_t *amount, int nowait);
/* Try and write out any pending writes to the device. If WAIT is non-zero,
will wait for any activity to cease. */
@@ -532,7 +532,7 @@ trivfs_S_io_write (struct trivfs_protid *cred,
return EBADF;
pthread_mutex_lock (&global_lock);
- err = dev_write ((void *)data, data_len, amount, cred->po->openmodes & O_NONBLOCK);
+ err = dev_write (data, data_len, amount, cred->po->openmodes & O_NONBLOCK);
pthread_mutex_unlock (&global_lock);
return err;
}
@@ -1092,7 +1092,7 @@ start_output (int nowait)
otherwise 0. */
/* Be careful that the global lock is already locked. */
error_t
-dev_write (void *buf, size_t len, size_t *amount, int nowait)
+dev_write (const void *buf, size_t len, size_t *amount, int nowait)
{
if (err)
return err;