From 2c99ad2dc97978b437794b14d58d9ae698ecabb9 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Thu, 12 Apr 2001 16:03:29 +0000 Subject: [PATCH] Cleanups for new gcc/glibc. --- dump/Makefile.in | 23 ++++++++--------------- dump/main.c | 4 ++-- dump/tape.c | 3 ++- restore/Makefile.in | 23 ++++++++--------------- restore/tape.c | 6 +++--- 5 files changed, 23 insertions(+), 36 deletions(-) diff --git a/dump/Makefile.in b/dump/Makefile.in index 555d3db..19f2aca 100644 --- a/dump/Makefile.in +++ b/dump/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.6 2001/04/06 10:09:40 stelian Exp $ +# $Id: Makefile.in,v 1.7 2001/04/12 16:03:29 stelian Exp $ top_srcdir= @top_srcdir@ srcdir= @srcdir@ @@ -11,19 +11,20 @@ LIBS= $(GLIBS) @ZLIB@ DEPLIBS= ../compat/lib/libcompat.a PROG= dump +RPROG= rdump LINKS= ${SBINDIR}/dump ${SBINDIR}/rdump SRCS= itime.c main.c optr.c tape.c traverse.c unctime.c OBJS= itime.o main.o optr.o tape.o traverse.o unctime.o \ ../common/dumprmt.o MAN8= dump.8 -MLINKS= $(MANDIR)/dump.8 $(MANDIR)/rdump.8 +RMAN8= rdump.8 -all:: $(PROG) dump.8 +all:: $(PROG) $(MAN8) $(PROG): $(OBJS) $(DEPLIBS) $(LD) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) -dump.8: dump.8.in +$(MAN8): dump.8.in sed -e "s|__DUMPDATES__|$(DUMPDATESPATH)|g" \ -e "s|__DATE__|$(DATE)|g" \ -e "s|__VERSION__|$(VERSION)|g" $< > $@ @@ -32,19 +33,11 @@ install:: all $(INSTALL) -d $(SBINDIR) $(MANDIR) $(INSTALLBIN) $(PROG) $(SBINDIR) $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR) - @set $(LINKS) $(MLINKS); \ - while test $$# -ge 2; do \ - l=$$1; \ - shift; \ - t=$$1; \ - shift; \ - echo $$t -\> $$l; \ - $(RM) -f $$t; \ - $(LN_S) $$l $$t; \ - done; true + cd $(SBINDIR) && $(RM) -f $(RPROG) && $(LN_S) $(PROG) $(RPROG) + cd $(MANDIR) && $(RM) -f $(RMAN8) && $(LN_S) $(MAN8) $(RMAN8) clean:: - $(RM) -f $(PROG) \#* *.s *.o *.a *~ core dump.8 + $(RM) -f $(PROG) $(MAN8) \#* *.s *.o *.a *~ core distclean:: clean $(RM) -f Makefile Makefile.old .depend diff --git a/dump/main.c b/dump/main.c index 13d15be..d3ebc82 100644 --- a/dump/main.c +++ b/dump/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.44 2001/04/11 15:24:03 stelian Exp $"; + "$Id: main.c,v 1.45 2001/04/12 16:03:29 stelian Exp $"; #endif /* not lint */ #include @@ -125,7 +125,7 @@ main(int argc, char *argv[]) int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1; dump_ino_t maxino; struct stat statbuf; - dev_t filedev; + dev_t filedev = 0; #ifdef __linux__ errcode_t retval; char directory[MAXPATHLEN]; diff --git a/dump/tape.c b/dump/tape.c index 38dd804..74bbcbd 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.42 2001/04/12 13:14:15 stelian Exp $"; + "$Id: tape.c,v 1.43 2001/04/12 16:03:29 stelian Exp $"; #endif /* not lint */ #include @@ -1154,6 +1154,7 @@ doslave(int cmd, int slave_number) if (compressed) { comp_buf->length = bufsize; worklen = TP_BSIZE + writesize; + compresult = Z_DATA_ERROR; if (do_compress) compresult = compress2(comp_buf->buf, &worklen, (char *)slp->tblock[0], writesize, compressed); diff --git a/restore/Makefile.in b/restore/Makefile.in index 397302f..527e910 100644 --- a/restore/Makefile.in +++ b/restore/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.7 2001/04/06 10:09:40 stelian Exp $ +# $Id: Makefile.in,v 1.8 2001/04/12 16:03:30 stelian Exp $ top_srcdir= @top_srcdir@ srcdir= @srcdir@ @@ -11,20 +11,21 @@ LIBS= $(GLIBS) -le2p @READLINE@ @ZLIB@ DEPLIBS= ../compat/lib/libcompat.a PROG= restore +RPROG= rrestore LINKS= ${SBINDIR}/restore ${SBINDIR}/rrestore SRCS= dirs.c interactive.c main.c restore.c symtab.c tape.c \ utilities.c OBJS= dirs.o interactive.o main.o restore.o symtab.o tape.o \ utilities.o ../common/dumprmt.o MAN8= restore.8 -MLINKS= $(MANDIR)/restore.8 $(MANDIR)/rrestore.8 +RMAN8= rrestore.8 -all:: $(PROG) restore.8 +all:: $(PROG) $(MAN8) $(PROG): $(OBJS) $(DEPLIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) -restore.8: restore.8.in +$(MAN8): restore.8.in sed -e "s|__DATE__|$(DATE)|g" \ -e "s|__VERSION__|$(VERSION)|g" $< > $@ @@ -32,19 +33,11 @@ install:: all $(INSTALL) -d $(SBINDIR) $(MANDIR) $(INSTALLBIN) $(PROG) $(SBINDIR) $(INSTALLMAN) $(srcdir)/$(MAN8) $(MANDIR) - @set $(LINKS) $(MLINKS); \ - while test $$# -ge 2; do \ - l=$$1; \ - shift; \ - t=$$1; \ - shift; \ - echo $$t -\> $$l; \ - $(RM) -f $$t; \ - $(LN_S) $$l $$t; \ - done; true + cd $(SBINDIR) && $(RM) -f $(RPROG) && $(LN_S) $(PROG) $(RPROG) + cd $(MANDIR) && $(RM) -f $(RMAN8) && $(LN_S) $(MAN8) $(RMAN8) clean:: - $(RM) -f $(PROG) \#* *.s *.o *.a *~ core restore.8 + $(RM) -f $(PROG) $(MAN8) \#* *.s *.o *.a *~ core distclean:: clean $(RM) -f Makefile Makefile.old .depend diff --git a/restore/tape.c b/restore/tape.c index 914db5c..f46ac48 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.33 2001/04/11 13:42:52 stelian Exp $"; + "$Id: tape.c,v 1.34 2001/04/12 16:03:30 stelian Exp $"; #endif /* not lint */ #include @@ -150,7 +150,7 @@ static void readtape_comprtape __P((char *)); static char *decompress_tapebuf __P((struct tapebuf *, int)); static void msg_read_error __P((char *)); #endif -static int read_a_block __P((int, void *, size_t, long *)); +static int read_a_block __P((int, char *, size_t, long *)); #define PREFIXSIZE sizeof(struct tapebuf) #define COMPARE_ONTHEFLY 1 @@ -1792,7 +1792,7 @@ findtapeblksize(void) /* * Read a block of data handling all of the messy details. */ -static int read_a_block(int fd, void *buf, size_t len, long *lengthread) +static int read_a_block(int fd, char *buf, size_t len, long *lengthread) { long i = 1, size; -- 2.39.5