diff options
-rw-r--r-- | src/MultiSrc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/MultiSrc.c b/src/MultiSrc.c index 7ad3cdd..a1b2035 100644 --- a/src/MultiSrc.c +++ b/src/MultiSrc.c @@ -966,15 +966,18 @@ static Boolean WriteToFile(String string, String name) { int fd; + Bool result = True; - if ( ((fd = creat(name, 0666)) == -1 ) || - (write(fd, string, sizeof(unsigned char) * strlen(string)) == -1) ) + if ((fd = creat(name, 0666)) == -1) return(FALSE); + if (write(fd, string, sizeof(unsigned char) * strlen(string)) == -1) + result = False; + if ( close(fd) == -1 ) return(FALSE); - return(TRUE); + return(result); } |