From 74f0bbfc53cb5fa519e4e27ece53735ab51b397c Mon Sep 17 00:00:00 2001 From: Rene Mayrhofer Date: Wed, 29 Oct 2008 20:30:44 +0000 Subject: - New upstream release. --- src/dumm/cowfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/dumm/cowfs.c') 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; -- cgit v1.2.3