summaryrefslogtreecommitdiff
path: root/libdiskfs/file-set-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-set-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-set-trans.c')
-rw-r--r--libdiskfs/file-set-trans.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 58f62550..6e1a61d2 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -32,7 +32,7 @@ diskfs_S_file_set_translator (struct protid *cred,
fsys_t active)
{
struct node *np;
- error_t error;
+ error_t err;
mach_port_t control = MACH_PORT_NULL;
if (!cred)
@@ -51,32 +51,32 @@ diskfs_S_file_set_translator (struct protid *cred,
pthread_mutex_lock (&np->lock);
- error = fshelp_isowner (&np->dn_stat, cred->user);
- if (error)
+ err = fshelp_isowner (&np->dn_stat, cred->user);
+ if (err)
{
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}
if ((active_flags & FS_TRANS_SET)
&& ! (active_flags & FS_TRANS_ORPHAN))
{
- error = fshelp_fetch_control (&np->transbox, &control);
- if (error)
+ err = fshelp_fetch_control (&np->transbox, &control);
+ if (err)
{
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}
if ((control != MACH_PORT_NULL) && ((active_flags & FS_TRANS_EXCL) == 0))
{
pthread_mutex_unlock (&np->lock);
- error = fsys_goaway (control, killtrans_flags);
+ err = fsys_goaway (control, killtrans_flags);
mach_port_deallocate (mach_task_self (), control);
- if (error && (error != MIG_SERVER_DIED)
- && (error != MACH_SEND_INVALID_DEST))
- return error;
- error = 0;
+ if (err && (err != MIG_SERVER_DIED)
+ && (err != MACH_SEND_INVALID_DEST))
+ return err;
+ err = 0;
pthread_mutex_lock (&np->lock);
}
else if (control != MACH_PORT_NULL)
@@ -94,12 +94,12 @@ diskfs_S_file_set_translator (struct protid *cred,
if (active_flags & FS_TRANS_SET)
{
- error = fshelp_set_active (&np->transbox, active,
+ err = fshelp_set_active (&np->transbox, active,
active_flags & FS_TRANS_EXCL);
- if (error)
+ if (err)
{
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}
}
@@ -158,12 +158,12 @@ diskfs_S_file_set_translator (struct protid *cred,
}
minor = strtol (arg, 0, 0);
- error = diskfs_validate_rdev_change (np,
+ err = diskfs_validate_rdev_change (np,
makedev (major, minor));
- if (error)
+ if (err)
{
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}
np->dn_stat.st_rdev = makedev (major, minor);
}
@@ -180,36 +180,36 @@ diskfs_S_file_set_translator (struct protid *cred,
}
if (diskfs_create_symlink_hook)
- error = (*diskfs_create_symlink_hook)(np, arg);
- if (!diskfs_create_symlink_hook || error == EINVAL)
+ err = (*diskfs_create_symlink_hook)(np, arg);
+ if (!diskfs_create_symlink_hook || err == EINVAL)
/* Store the argument in the file as the
target of the link */
- error = diskfs_node_rdwr (np, arg, 0, strlen (arg),
+ err = diskfs_node_rdwr (np, arg, 0, strlen (arg),
1, cred, 0);
- if (error)
+ if (err)
{
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}
}
newmode = (np->dn_stat.st_mode & ~S_IFMT) | newmode;
- error = diskfs_validate_mode_change (np, newmode);
- if (!error)
+ err = diskfs_validate_mode_change (np, newmode);
+ if (!err)
{
np->dn_stat.st_mode = newmode;
diskfs_node_update (np, diskfs_synchronous);
}
pthread_mutex_unlock (&np->lock);
- return error;
+ return err;
}
}
- error = diskfs_set_translator (np, passive, passivelen, cred);
+ err = diskfs_set_translator (np, passive, passivelen, cred);
}
pthread_mutex_unlock (&np->lock);
- if (! error && cred->po->path && active_flags & FS_TRANS_SET)
- error = fshelp_set_active_translator (&cred->pi, cred->po->path, active);
+ if (! err && cred->po->path && active_flags & FS_TRANS_SET)
+ err = fshelp_set_active_translator (&cred->pi, cred->po->path, active);
- return error;
+ return err;
}