projects
/
vimb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58a1b39
)
Fixed file locking using fcntl.
author
Yutao Yuan
<yyt16384@gmail.com>
Mon, 12 Oct 2015 05:11:51 +0000
(13:11 +0800)
committer
Yutao Yuan
<yyt16384@gmail.com>
Mon, 12 Oct 2015 05:11:51 +0000
(13:11 +0800)
src/cookiejar.c
patch
|
blob
|
history
src/main.h
patch
|
blob
|
history
diff --git
a/src/cookiejar.c
b/src/cookiejar.c
index
9f109de
..
23ea525
100644
(file)
--- a/
src/cookiejar.c
+++ b/
src/cookiejar.c
@@
-90,7
+90,7
@@
static void cookiejar_finalize(GObject *self)
static void cookiejar_init(CookieJar *self)
{
- self->lock = open(vb.files[FILES_COOKIE],
0
);
+ self->lock = open(vb.files[FILES_COOKIE],
O_RDWR
);
}
static void cookiejar_set_property(GObject *self, guint prop_id, const
diff --git
a/src/main.h
b/src/main.h
index
562e310
..
7e4c035
100644
(file)
--- a/
src/main.h
+++ b/
src/main.h
@@
-43,7
+43,7
@@
#define FLOCK(fd, cmd) { \
struct flock lock = {.l_type=cmd,.l_start=0,.l_whence=SEEK_SET,.l_len=0}; \
- fcntl(fd, F_SETLK
,
lock); \
+ fcntl(fd, F_SETLK
W, &
lock); \
}
#ifdef DEBUG