summaryrefslogtreecommitdiff
path: root/libdiskfs/file-get-trans.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-01-19 14:16:51 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-01-19 14:16:51 +0100
commit002b46da8a4270b89003a28b4f5431d857cd0b33 (patch)
treef8471e2e238ac7a79a7eccfbfc1ac0742849bba6 /libdiskfs/file-get-trans.c
parent9bebcd38f42da289a3eaf9f473a9529f8d3c4664 (diff)
Rename variables with the name "error" to "err".
The canonical name for variables of the type error_t is err. There are, however, places where the variable is called error instead. This is unfortunate, as this shadows the error function. Rename such variables to err. For reference, this is accomplished using the following semantic patch: @@ expression E; @@ -error_t error = E; +error_t err = E; <... -error +err ...> @@ @@ -error_t error; +error_t err; <... -error +err ...> * libdiskfs/dir-link.c: Rename error to err. * libdiskfs/dir-unlink.c: Likewise. * libdiskfs/file-get-trans.c: Likewise. * libdiskfs/file-get-transcntl.c: Likewise. * libdiskfs/file-set-trans.c: Likewise. * libdiskfs/fsys-getroot.c: Likewise. * libshouldbeinlibc/wire.c: Likewise.
Diffstat (limited to 'libdiskfs/file-get-trans.c')
-rw-r--r--libdiskfs/file-get-trans.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c
index 11ed439e..db5bbdad 100644
--- a/libdiskfs/file-get-trans.c
+++ b/libdiskfs/file-get-trans.c
@@ -28,7 +28,7 @@ diskfs_S_file_get_translator (struct protid *cred,
size_t *translen)
{
struct node *np;
- error_t error = 0;
+ error_t err = 0;
if (!cred)
return EOPNOTSUPP;
@@ -48,16 +48,16 @@ diskfs_S_file_get_translator (struct protid *cred,
bcopy (_HURD_SYMLINK, *trans, sizeof _HURD_SYMLINK);
if (diskfs_read_symlink_hook)
- error = (*diskfs_read_symlink_hook) (np,
+ err = (*diskfs_read_symlink_hook) (np,
*trans + sizeof _HURD_SYMLINK);
- if (!diskfs_read_symlink_hook || error == EINVAL)
+ if (!diskfs_read_symlink_hook || err == EINVAL)
{
- error = diskfs_node_rdwr (np, *trans + sizeof _HURD_SYMLINK,
+ err = diskfs_node_rdwr (np, *trans + sizeof _HURD_SYMLINK,
0, np->dn_stat.st_size, 0, cred, &amt);
- if (!error)
+ if (!err)
assert (amt == np->dn_stat.st_size);
}
- if (!error)
+ if (!err)
{
(*trans)[sizeof _HURD_SYMLINK + np->dn_stat.st_size] = '\0';
*translen = len;
@@ -88,7 +88,7 @@ diskfs_S_file_get_translator (struct protid *cred,
bcopy (buf, *trans, buflen);
free (buf);
*translen = buflen;
- error = 0;
+ err = 0;
}
else if (S_ISFIFO (np->dn_stat.st_mode))
{
@@ -99,7 +99,7 @@ diskfs_S_file_get_translator (struct protid *cred,
*trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_FIFO, *trans, sizeof _HURD_FIFO);
*translen = len;
- error = 0;
+ err = 0;
}
else if (S_ISSOCK (np->dn_stat.st_mode))
{
@@ -110,18 +110,18 @@ diskfs_S_file_get_translator (struct protid *cred,
*trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_IFSOCK, *trans, sizeof _HURD_IFSOCK);
*translen = len;
- error = 0;
+ err = 0;
}
else
{
if (! (np->dn_stat.st_mode & S_IPTRANS))
- error = EINVAL;
+ err = EINVAL;
else
{
char *string;
u_int len;
- error = diskfs_get_translator (np, &string, &len);
- if (!error)
+ err = diskfs_get_translator (np, &string, &len);
+ if (!err)
{
if (len > *translen)
*trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
@@ -134,5 +134,5 @@ diskfs_S_file_get_translator (struct protid *cred,
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}