From 4c450f23577915c30ecf3a8660bb5ae6ac8edc65 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 28 Sep 2004 18:57:58 +0000 Subject: [PATCH] seek to the start of the file before calling lockf(). 2004-09-28 Sven Neumann * app/file/gimprecentlist.c: seek to the start of the file before calling lockf(). --- ChangeLog | 5 +++++ app/file/gimprecentlist.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 72708608ca..ff981c05d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-28 Sven Neumann + + * app/file/gimprecentlist.c: seek to the start of the file before + calling lockf(). + 2004-09-28 Maurits Rijk * plug-ins/common/borderaverage.c: added size entry. Fixes #143156 diff --git a/app/file/gimprecentlist.c b/app/file/gimprecentlist.c index 4d9a3281b1..6cecf3c577 100644 --- a/app/file/gimprecentlist.c +++ b/app/file/gimprecentlist.c @@ -26,6 +26,7 @@ #include "config.h" +#include #include #include #include @@ -489,6 +490,8 @@ gimp_recent_list_lock_file (gint fd) * changes. */ + lseek (fd, 0, SEEK_SET); + for (i = 0; i < 5; i++) { gint rand_interval; @@ -507,6 +510,8 @@ gimp_recent_list_lock_file (gint fd) static gboolean gimp_recent_list_unlock_file (gint fd) { + lseek (fd, 0, SEEK_SET); + return (lockf (fd, F_ULOCK, 0) == 0) ? TRUE : FALSE; }