Fix write() errno error

This commit is contained in:
shenlongxing
2018-06-04 23:59:21 +08:00
committed by antirez
parent b61416bdf4
commit c85ae56edc
3 changed files with 6 additions and 5 deletions

View File

@ -5575,7 +5575,7 @@ static void getRDB(void) {
nwritten = write(fd, buf, nread);
if (nwritten != nread) {
fprintf(stderr,"Error writing data to file: %s\n",
strerror(errno));
(nwritten == -1) ? strerror(errno) : "short write");
exit(1);
}
payload -= nread;