diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-15 12:23:27 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-17 15:48:33 +0200 |
commit | edef91ee25eddcda1db9af64c99d3913c45e3a18 (patch) | |
tree | b18f3d2462cffbd93be7360b4a3474c2e541f9a6 /src | |
parent | 54738368ec469dd9706c5c8f97d24affde9edae8 (diff) | |
download | libgit2-edef91ee25eddcda1db9af64c99d3913c45e3a18.tar.gz |
fileops: set an error on write error for file copycmn/path-direach-cberror
We set an error if we get an error when reading, but we don't bother
setting an error message for write failing. This causes a cryptic error
to be shown to the user when the target filesystem is full.
Diffstat (limited to 'src')
-rw-r--r-- | src/fileops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c index 566aed1c1..b7b55159f 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -703,6 +703,9 @@ static int cp_by_fd(int ifd, int ofd, bool close_fd_when_done) error = (int)len; } + if (error < 0) + giterr_set(GITERR_OS, "write error while copying file"); + if (close_fd_when_done) { p_close(ifd); p_close(ofd); |