Thread (40 messages) 40 messages, 1 author, 2016-06-15

[PATCH v6 16/39] remove_lock_file(): call rollback_lock_file()

flat view
DORMANTno replies REVIEWED: 1 (0M)

From: Michael Haggerty <hidden>
Date: 2016-06-15 23:02:35
Subsystem: the rest · Maintainer: Linus Torvalds

Revision v6 of 6 in this series; 1 review trailer.

Revisions (6)
  1. v2 [diff vs current]
  2. v3 [diff vs current]
  3. v4 [diff vs current]
  4. v5 [diff vs current]
  5. v6 current
  6. v7 [diff vs current]
It does just what we need.

Signed-off-by: Michael Haggerty <redacted>
Reviewed-by: Jonathan Nieder <redacted>
---
 lockfile.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lockfile.c b/lockfile.c
index a8f32e5..f8205f6 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -53,12 +53,8 @@ static void remove_lock_file(void)
 	pid_t me = getpid();
 
 	while (lock_file_list) {
-		if (lock_file_list->owner == me &&
-		    lock_file_list->filename[0]) {
-			if (lock_file_list->fd >= 0)
-				close(lock_file_list->fd);
-			unlink_or_warn(lock_file_list->filename);
-		}
+		if (lock_file_list->owner == me)
+			rollback_lock_file(lock_file_list);
 		lock_file_list = lock_file_list->next;
 	}
 }
-- 
2.1.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help