[RFC/PATCH 28/48] builtin/apply: move 'lock_file' global into 'struct apply_state'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
---
 builtin/apply.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/builtin/apply.c b/builtin/apply.c
index 44fdb9d..70bb51a 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -67,6 +67,8 @@ struct apply_state {
 	int line_termination;
 
 	unsigned int p_context;
+
+	struct lock_file lock_file;
 };
 
 static int p_value = 1;
@@ -4429,8 +4431,6 @@ static int write_out_results(struct apply_state *state, struct patch *list)
 	return errs;
 }
 
-static struct lock_file lock_file;
-
 #define INACCURATE_EOF	(1<<0)
 #define RECOUNT		(1<<1)
 
@@ -4479,7 +4479,7 @@ static int apply_patch(struct apply_state *state,
 
 	state->update_index = state->check_index && state->apply;
 	if (state->update_index && state->newfd < 0)
-		state->newfd = hold_locked_index(&lock_file, 1);
+		state->newfd = hold_locked_index(&state->lock_file, 1);
 
 	if (state->check_index) {
 		if (read_cache() < 0)
@@ -4748,7 +4748,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
 	}
 
 	if (state.update_index) {
-		if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
+		if (write_locked_index(&the_index, &state.lock_file, COMMIT_LOCK))
 			die(_("Unable to write new index file"));
 	}
 
-- 
2.8.0.rc1.49.gca61272

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]