OSDN Git Service

Pass file descriptor instead of file name
authorAnatol Pomazau <anatol@google.com>
Wed, 11 Jan 2012 23:12:27 +0000 (15:12 -0800)
committerAnatol Pomazau <anatol@google.com>
Fri, 3 Feb 2012 22:40:49 +0000 (14:40 -0800)
commit89ddaab97e9214cf331baffee2de4595ad14dc79
tree08f4de0ccce24a3b3672db9ec3f60e461c52f74c
parentae4f7dccadfafc36470a3e6f3084c6cf3cc63415
Pass file descriptor instead of file name

Passing a file descriptor to make_ext4fs_internal() is more flexible.
We can use tmpfile() to create a temporary file.
tmpfile() is better than other solutions because it unlinks the file
right after creating it, so closing fd effectively removes temp file.
Thus we don't have to worry about large temp files accidently left
on the filesystem in case of the program crash.

Change-Id: I44146704572c314e1d6cfca7ce918efa7fb92a7a
ext4_utils/ext2simg.c
ext4_utils/ext4_utils.c
ext4_utils/ext4_utils.h
ext4_utils/make_ext4fs.c
ext4_utils/make_ext4fs.h
ext4_utils/make_ext4fs_main.c
ext4_utils/output_file.c
ext4_utils/output_file.h