image: use fileio_write_file
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
dcae99eca5
commit
9389752741
1 changed files with 1 additions and 12 deletions
13
src/image.c
13
src/image.c
|
@ -511,16 +511,5 @@ out:
|
|||
|
||||
int image_write_detached(struct image *image, const char *filename)
|
||||
{
|
||||
int fd, rc;
|
||||
|
||||
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
if (fd < 0) {
|
||||
perror("open");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = write_all(fd, image->sigbuf, image->sigsize);
|
||||
|
||||
close(fd);
|
||||
return !rc;
|
||||
return fileio_write_file(filename, image->sigbuf, image->sigsize);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue