summaryrefslogtreecommitdiff
path: root/Build/source/libs/zziplib/zziplib-src/bins/zzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/zziplib/zziplib-src/bins/zzip.c')
-rw-r--r--Build/source/libs/zziplib/zziplib-src/bins/zzip.c48
1 files changed, 2 insertions, 46 deletions
diff --git a/Build/source/libs/zziplib/zziplib-src/bins/zzip.c b/Build/source/libs/zziplib/zziplib-src/bins/zzip.c
index 2869a36a611..965f60d6957 100644
--- a/Build/source/libs/zziplib/zziplib-src/bins/zzip.c
+++ b/Build/source/libs/zziplib/zziplib-src/bins/zzip.c
@@ -11,6 +11,7 @@
#include <zzip/write.h>
#include <stdio.h>
#include <string.h>
+#include "zzipmake-zip.h"
#ifdef ZZIP_HAVE_UNISTD_H
#include <unistd.h>
@@ -19,10 +20,6 @@
#include <io.h>
#endif
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
static const char usage[] =
{
"zzip <dir> files... \n"
@@ -51,48 +48,7 @@ main (int argc, char ** argv)
return 0;
}
- dir = zzip_dir_creat(argv[1], 0755);
- if (! dir)
- {
- fprintf (stderr, "did not creat %s: \n", argv[1]);
- perror(argv[1]);
- if (1)
- return 1;
- else
- fprintf (stderr, "(ignored)\n");
- }
-
- for (argn=2; argn < argc; argn++)
- {
- int input = open (argv[argn], O_RDONLY);
- if (input == -1)
- {
- perror (argv[argn]);
- continue;
- }
- else
- {
- char buf[17]; zzip_ssize_t n;
- ZZIP_FILE* output = zzip_file_creat (dir, argv[argn], 0755);
- if (! output)
- {
- fprintf (stderr, "|did not open %s: \n", argv[argn]);
- fprintf (stderr, "|%s: %s\n", argv[argn],
- zzip_strerror_of(dir));
- continue;
- }
-
- while ((n = read (input, buf, 16)))
- {
- zzip_write (output, buf, n);
- }
- zzip_close (output);
- }
- close (input);
- }
- zzip_closedir(dir);
-
- return exitcode;
+ return rezzip_make(argc, argv);
}
/*