Add format_write() that calls the write() function of the output
format. Have the raw format use image_copyout() for now.
This commit is contained in:
parent
fdd67dad26
commit
bd79c282bb
10
format.c
10
format.c
@ -65,3 +65,13 @@ format_selected(void)
|
||||
|
||||
return (format);
|
||||
}
|
||||
|
||||
int
|
||||
format_write(int fd)
|
||||
{
|
||||
|
||||
if (format == NULL)
|
||||
return (ENOSYS);
|
||||
|
||||
return (format->write(fd));
|
||||
}
|
||||
|
1
format.h
1
format.h
@ -42,5 +42,6 @@ SET_DECLARE(formats, struct mkimg_format);
|
||||
|
||||
int format_select(const char *);
|
||||
struct mkimg_format *format_selected(void);
|
||||
int format_write(int);
|
||||
|
||||
#endif /* _MKIMG_FORMAT_H_ */
|
||||
|
2
mkimg.c
2
mkimg.c
@ -451,7 +451,7 @@ main(int argc, char *argv[])
|
||||
fprintf(stderr, "Number of cylinders: %u\n", ncyls);
|
||||
}
|
||||
|
||||
error = image_copyout(outfd);
|
||||
error = format_write(outfd);
|
||||
if (error)
|
||||
errc(EX_IOERR, error, "writing image");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user