From 002b46da8a4270b89003a28b4f5431d857cd0b33 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 19 Jan 2014 14:16:51 +0100 Subject: 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. --- libdiskfs/dir-link.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'libdiskfs/dir-link.c') diff --git a/libdiskfs/dir-link.c b/libdiskfs/dir-link.c index 45d88948..ca5dd561 100644 --- a/libdiskfs/dir-link.c +++ b/libdiskfs/dir-link.c @@ -29,7 +29,7 @@ diskfs_S_dir_link (struct protid *dircred, struct node *tnp; /* node being deleted implicitly */ struct node *dnp; /* directory of new entry */ struct dirstat *ds = alloca (diskfs_dirstat_size); - error_t error; + error_t err; if (!dircred) return EOPNOTSUPP; @@ -53,19 +53,19 @@ diskfs_S_dir_link (struct protid *dircred, pthread_mutex_lock (&dnp->lock); /* Lookup new location */ - error = diskfs_lookup (dnp, name, RENAME, &tnp, ds, dircred); - if (!error && excl) + err = diskfs_lookup (dnp, name, RENAME, &tnp, ds, dircred); + if (!err && excl) { - error = EEXIST; + err = EEXIST; diskfs_nput (tnp); } - if (error && error != ENOENT) + if (err && err != ENOENT) { - if (error == EAGAIN) - error = EINVAL; + if (err == EAGAIN) + err = EINVAL; diskfs_drop_dirstat (dnp, ds); pthread_mutex_unlock (&dnp->lock); - return error; + return err; } if (np == tnp) @@ -107,8 +107,8 @@ diskfs_S_dir_link (struct protid *dircred, if (tnp) { assert (!excl); - error = diskfs_dirrewrite (dnp, tnp, np, name, ds); - if (!error) + err = diskfs_dirrewrite (dnp, tnp, np, name, ds); + if (!err) { /* Deallocate link on TNP */ tnp->dn_stat.st_nlink--; @@ -119,15 +119,15 @@ diskfs_S_dir_link (struct protid *dircred, diskfs_nput (tnp); } else - error = diskfs_direnter (dnp, name, np, ds, dircred); + err = diskfs_direnter (dnp, name, np, ds, dircred); if (diskfs_synchronous) diskfs_node_update (dnp, 1); pthread_mutex_unlock (&dnp->lock); pthread_mutex_unlock (&np->lock); - if (!error) + if (!err) /* MiG won't do this for us, which it ought to. */ mach_port_deallocate (mach_task_self (), filecred->pi.port_right); - return error; + return err; } -- cgit v1.2.3