X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Flib_internal%2Funify-copy.c;h=554c0771f1f43d3e26a0d5541dbbd5e077a76bee;hb=35f92ae82ef67ab372f8953346f11ea911e4e901;hp=c67b48e79dfab199c984eb0c847447c524d972e8;hpb=68a4cdcaa9dbc6a451b8c29736133b25f9ef34b2;p=util-vserver.git diff --git a/util-vserver/lib_internal/unify-copy.c b/util-vserver/lib_internal/unify-copy.c index c67b48e..554c077 100644 --- a/util-vserver/lib_internal/unify-copy.c +++ b/util-vserver/lib_internal/unify-copy.c @@ -63,7 +63,7 @@ copyReg(char const *src, struct stat const *src_stat, char const *dst) { int in_fd = open(src, O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_LARGEFILE); - int out_fd = in_fd==-1 ? -1 : open(dst, O_CREAT|O_EXCL, 0200); + int out_fd = in_fd==-1 ? -1 : open(dst, O_RDWR|O_CREAT|O_EXCL, 0200); bool res = false; if (in_fd==-1 || out_fd==-1 || @@ -74,7 +74,7 @@ copyReg(char const *src, struct stat const *src_stat, ssize_t l = read(in_fd, buf, sizeof buf); if (l==-1) goto err; if (l==0) break; - if (!WwriteAll(out_fd, buf, l, 0)) return false; + if (!WwriteAll(out_fd, buf, l, 0)) goto err; } res = true;