[gen_init_cpio] When outputting a buffer, don't use char-at-a-time I/O.
authorJeff Garzik <jgarzik@pobox.com>
Thu, 10 Feb 2005 08:16:50 +0000 (03:16 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Thu, 10 Feb 2005 08:16:50 +0000 (03:16 -0500)
usr/gen_init_cpio.c

index 10bb8f8..33dbcbf 100644 (file)
@@ -295,7 +295,6 @@ static int cpio_mkfile(const char *name, const char *location,
        struct stat buf;
        int file = -1;
        int retval;
-       int i;
        int rc = -1;
 
        mode |= S_IFREG;
@@ -344,8 +343,7 @@ static int cpio_mkfile(const char *name, const char *location,
        push_string(name);
        push_pad();
 
-       for (i = 0; i < buf.st_size; ++i)
-               fputc(filebuf[i], stdout);
+       fwrite(filebuf, buf.st_size, 1, stdout);
        offset += buf.st_size;
        push_pad();
        rc = 0;