diff options
author | Anatol Pomazau <anatol@google.com> | 2012-02-03 10:57:40 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-03 10:57:40 -0800 |
commit | ae4f7dccadfafc36470a3e6f3084c6cf3cc63415 (patch) | |
tree | e9df9977417c5df1e15c07df7ef6cb6dad75cac8 /ext4_utils/make_ext4fs_main.c | |
parent | 93eb1dc9e68d2e9dea94f56d8bce478c1a52b354 (diff) | |
download | extras-ae4f7dccadfafc36470a3e6f3084c6cf3cc63415.tar.gz |
Revert "Pass file descriptor instead of file name"
This reverts commit 93eb1dc9e68d2e9dea94f56d8bce478c1a52b354
Diffstat (limited to 'ext4_utils/make_ext4fs_main.c')
-rw-r--r-- | ext4_utils/make_ext4fs_main.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c index b83f57ee..d616c6d4 100644 --- a/ext4_utils/make_ext4fs_main.c +++ b/ext4_utils/make_ext4fs_main.c @@ -14,9 +14,8 @@ * limitations under the License. */ -#include <fcntl.h> -#include <libgen.h> #include <unistd.h> +#include <libgen.h> #if defined(__linux__) #include <linux/fs.h> @@ -50,8 +49,6 @@ int main(int argc, char **argv) int crc = 0; int wipe = 0; int init_itabs = 0; - int fd; - int exitcode; while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:fwzJsct")) != -1) { switch (opt) { @@ -142,19 +139,6 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - if (strcmp(filename, "-")) { - fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644); - if (fd < 0) { - error_errno("open"); - return EXIT_FAILURE; - } - } else { - fd = STDOUT_FILENO; - } - - exitcode = make_ext4fs_internal(fd, directory, mountpoint, android, gzip, + return make_ext4fs_internal(filename, directory, mountpoint, android, gzip, sparse, crc, wipe, init_itabs); - close(fd); - - return exitcode; } |