apply_unveil() doesn't call err(3) so rename 'error' to 'err'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/got/got.c b/got/got.c
index f03bfda..0aeb627 100644
--- a/got/got.c
+++ b/got/got.c
@@ -219,39 +219,39 @@ apply_unveil(const char *repo_path, int repo_read_only,
const char *worktree_path, int create_worktree,
int unveil_editor)
{
- const struct got_error *error;
+ const struct got_error *err;
static char err_msg[MAXPATHLEN + 36];
if (create_worktree) {
/* Pre-create work tree path to avoid unveiling its parents. */
- error = got_path_mkdir(worktree_path);
+ err = got_path_mkdir(worktree_path);
if (errno == EEXIST) {
if (got_path_dir_is_empty(worktree_path)) {
errno = 0;
- error = NULL;
+ err = NULL;
} else {
snprintf(err_msg, sizeof(err_msg),
"%s: directory exists but is not empty",
worktree_path);
- error = got_error_msg(GOT_ERR_BAD_PATH,
+ err = got_error_msg(GOT_ERR_BAD_PATH,
err_msg);
}
}
- if (error && (error->code != GOT_ERR_ERRNO || errno != EISDIR))
- return error;
+ if (err && (err->code != GOT_ERR_ERRNO || errno != EISDIR))
+ return err;
}
if (unveil_editor) {
char *editor;
- error = get_editor(&editor);
- if (error)
- return error;
+ err = get_editor(&editor);
+ if (err)
+ return err;
if (unveil(editor, "x") != 0) {
- error = got_error_from_errno2("unveil", editor);
+ err = got_error_from_errno2("unveil", editor);
free(editor);
- return error;
+ return err;
}
free(editor);
}
@@ -265,9 +265,9 @@ apply_unveil(const char *repo_path, int repo_read_only,
if (unveil("/tmp", "rwc") != 0)
return got_error_from_errno2("unveil", "/tmp");
- error = got_privsep_unveil_exec_helpers();
- if (error != NULL)
- return error;
+ err = got_privsep_unveil_exec_helpers();
+ if (err != NULL)
+ return err;
if (unveil(NULL, NULL) != 0)
return got_error_from_errno("unveil");