g[un]zip: add support for -v (verbose).

Add CONFIG_DESKTOP, almost all bloat from this change
is hidden under that.
This commit is contained in:
Denis Vlasenko
2006-10-01 15:55:11 +00:00
parent f8aa109a9f
commit 97a8dd3857
15 changed files with 122 additions and 72 deletions

View File

@@ -11,7 +11,8 @@
#include "unarchive.h"
/* transformer(), more than meets the eye */
int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd))
int open_transformer(int src_fd,
USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd))
{
int fd_pipe[2];
int pid;
@@ -28,6 +29,7 @@ int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd))
if (pid == 0) {
/* child process */
close(fd_pipe[0]); /* We don't wan't to read from the parent */
// FIXME: error check?
transformer(src_fd, fd_pipe[1]);
close(fd_pipe[1]); /* Send EOF */
close(src_fd);
@@ -38,5 +40,5 @@ int open_transformer(int src_fd, int (*transformer)(int src_fd, int dst_fd))
/* parent process */
close(fd_pipe[1]); /* Don't want to write to the child */
return(fd_pipe[0]);
return fd_pipe[0];
}