Fix CID 1215124: Handle errors properly.
This commit is contained in:
parent
a513818762
commit
645c72194e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266512
@ -119,8 +119,12 @@ image_copyout(int fd)
|
||||
}
|
||||
}
|
||||
free(buffer);
|
||||
if (error)
|
||||
return (error);
|
||||
ofs = lseek(fd, 0L, SEEK_CUR);
|
||||
ftruncate(fd, ofs);
|
||||
if (ofs == -1)
|
||||
return (errno);
|
||||
error = (ftruncate(fd, ofs) == -1) ? errno : 0;
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user