Commit c7606541 by Carlos Martín Nieto

fileops: set an error on write error for file copy

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.
parent 9e749542
......@@ -664,6 +664,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment