about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/stdio/ftrylockfile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/ftrylockfile.c b/src/stdio/ftrylockfile.c
index 6f9a4b88..eb13c839 100644
--- a/src/stdio/ftrylockfile.c
+++ b/src/stdio/ftrylockfile.c
@@ -34,6 +34,7 @@ int ftrylockfile(FILE *f)
 	f->lockcount = 1;
 	f->prev_locked = 0;
 	f->next_locked = self->stdio_locks;
+	if (f->next_locked) f->next_locked->prev_locked = f;
 	self->stdio_locks = f;
 	return 0;
 }