From 251d974a658d07cac73b3a0904ddabd20bf6cc5c Mon Sep 17 00:00:00 2001 From: Erik Troan Date: Tue, 13 Nov 2001 22:15:29 +0000 Subject: changes for diet --- collage/Makefile | 2 +- collage/commands.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/collage/Makefile b/collage/Makefile index 6696d3191..38450774d 100644 --- a/collage/Makefile +++ b/collage/Makefile @@ -2,7 +2,7 @@ include ../Makefile.inc CFLAGS = -Wall -g -O2 LDFLAGS = -g -LOADLIBES = -L../isys -lisys -lresolv -lz +LOADLIBES = -L../isys -L../isys/gzlib -lisys -lgunzip -lresolv -lz ifeq (.depend,$(wildcard .depend)) TARGET=all diff --git a/collage/commands.c b/collage/commands.c index 59e014681..802c90a5f 100644 --- a/collage/commands.c +++ b/collage/commands.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -10,7 +11,6 @@ #include #include #include -#include #include "../isys/imount.h" #include "../isys/isys.h" @@ -19,6 +19,16 @@ #include "mount_by_label.h" #include "../isys/cpio.h" +int mygethostbyname(char * host, struct in_addr * address) { + struct hostent * hostinfo; + + hostinfo = gethostbyname(host); + if (!hostinfo) return 1; + + memcpy(address, hostinfo->h_addr_list[0], hostinfo->h_length); + return 0; +} + static int copyfd(int to, int from); static int copyfd(int to, int from) { @@ -190,10 +200,12 @@ int uncpioCommand(int argc, char ** argv) { return 1; } - cfd = gzdopen(0, "r"); + cfd = gunzip_dopen(0); rc = myCpioInstallArchive(cfd, NULL, 0, NULL, NULL, &fail); + gunzip_close(cfd); + if (rc) { fprintf(stderr, "cpio failed on %s: ", fail); if (rc & CPIOERR_CHECK_ERRNO) -- cgit