summaryrefslogtreecommitdiff
path: root/src/dumm/cowfs.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 20:30:44 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 20:30:44 +0000
commit74f0bbfc53cb5fa519e4e27ece53735ab51b397c (patch)
tree0dbab9c835be15577ff05b474b6361bb326d66ce /src/dumm/cowfs.c
parent5c1fa2516bda1ccf8eb00178c0beb196c2020a94 (diff)
downloadvyos-strongswan-74f0bbfc53cb5fa519e4e27ece53735ab51b397c.tar.gz
vyos-strongswan-74f0bbfc53cb5fa519e4e27ece53735ab51b397c.zip
- New upstream release.
Diffstat (limited to 'src/dumm/cowfs.c')
-rw-r--r--src/dumm/cowfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dumm/cowfs.c b/src/dumm/cowfs.c
index 4c16c7c5d..88041811e 100644
--- a/src/dumm/cowfs.c
+++ b/src/dumm/cowfs.c
@@ -709,8 +709,9 @@ static int cowfs_write(const char *path, const char *buf, size_t size,
rel(&path);
- fd = get_rd(path);
- if (fd == this->master_fd)
+ fd = get_wr(path);
+ if (fd == this->master_fd ||
+ (this->over_fd > 0 && fd == this->host_fd))
{
fd = copy(path);
if (fd < 0)
@@ -858,13 +859,15 @@ cowfs_t *cowfs_create(char *master, char *host, char *mount)
{
DBG1("failed to open master filesystem '%s'", master);
free(this);
+ return NULL;
}
this->host_fd = open(host, O_RDONLY | O_DIRECTORY);
- if (this->master_fd < 0)
+ if (this->host_fd < 0)
{
DBG1("failed to open host filesystem '%s'", host);
close(this->master_fd);
free(this);
+ return NULL;
}
this->over_fd = -1;