aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-07-03 11:40:06 +0200
committerThomas White <taw@physics.org>2012-07-03 11:40:06 +0200
commit2ad671969e26dc1d2650c6af25ec44d53ff223ee (patch)
treed2d521797a9a00934e0843c517cd96395469792f /src
parentf36ea6e42ac2909db5beaa30104bb09844fd225d (diff)
Locking fussiness
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index fe4960fc..1981908e 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -283,7 +283,7 @@ static void process_image(const struct index_args *iargs,
char *outfilename = iargs->outfile;
int fd;
FILE *fh;
- struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0};
+ struct flock fl;
image.features = NULL;
image.data = NULL;
@@ -409,7 +409,10 @@ static void process_image(const struct index_args *iargs,
}
/* Write Lock */
- fl.l_pid = getpid();
+ fl.l_type = F_WRLCK;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0; /* Means "lock the whole file" */
fd = open(outfile, O_WRONLY);
if ( fd == -1 ) {