summaryrefslogtreecommitdiff
path: root/src/dumm/cowfs.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
commit8b80ab5a6950ce6515f477624794defd7531642a (patch)
treeaa8303f3806c5615fbeafc4dc82febe3cd7c24dc /src/dumm/cowfs.c
parentdb67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff)
downloadvyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz
vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
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;