libixp

git clone git://oldgit.suckless.org/libixp/
Log | Files | Refs | LICENSE

commit e244f83e4ccf00fc0be852ff6dc1ea14865dde2b
parent b7bfd010155bef9f052d67b31844590dde225683
Author: Kris Maglione <jg@suckless.org>
Date:   Mon, 26 Mar 2007 14:27:29 -0400

Fixed some bugs.

Diffstat:
libixp/convert.c | 6++++--
libixp/request.c | 9++++++++-
man/Makefile | 2--
mk/common.mk | 1+
mk/dir.mk | 30+++++++++++++++---------------
mk/hdr.mk | 34+++++++++++++++++++++++++++-------
mk/lib.mk | 1+
mk/man.mk | 1+
mk/many.mk | 7++++---
mk/one.mk | 1+
10 files changed, 62 insertions(+), 30 deletions(-)

diff --git a/libixp/convert.c b/libixp/convert.c @@ -132,11 +132,13 @@ ixp_pstrings(Message *msg, ushort *num, char *strings[]) { ixp_pu16(msg, &len); if(msg->mode == MsgUnpack) { + memcpy(s, msg->pos, len); strings[i] = s; s += len; + msg->pos += len; *s++ = '\0'; - } - ixp_pdata(msg, &strings[i], len); + }else + ixp_pdata(msg, &strings[i], len); } } diff --git a/libixp/request.c b/libixp/request.c @@ -369,7 +369,14 @@ respond(Ixp9Req *r, char *error) { ixp_hangup(pc->conn); } - ixp_freefcall(&r->ofcall); + switch(r->ofcall.type) { + case RStat: + free(r->ofcall.stat); + break; + case RRead: + free(r->ofcall.data); + break; + } free(r); pc->ref--; diff --git a/man/Makefile b/man/Makefile @@ -3,6 +3,4 @@ include ${ROOT}/mk/hdr.mk TARG = ixpc.1 -FILTER = cat - include ${ROOT}/mk/man.mk diff --git a/mk/common.mk b/mk/common.mk @@ -11,6 +11,7 @@ mkdirs: done install: ${HFILES:.h=.install} +uninstall: ${HFILES:.h=.uninstall} cleandep: rm .depend 2>/dev/null || true diff --git a/mk/dir.mk b/mk/dir.mk @@ -1,25 +1,25 @@ -dall: +MKSUBDIR = targ=$@; \ for i in ${DIRS}; do \ - echo MAKE all ${BASE}$$i/; \ - (cd $$i && ${MAKE} BASE="${BASE}$$i/" all) || exit 1; \ + if [ ! -d $$i ]; then \ + echo Skipping nonexistent directory: $$i 1>&2; \ + else \ + echo MAKE $${targ\#d} ${BASE}$$i/; \ + (cd $$i && ${MAKE} BASE="${BASE}$$i/" $${targ\#d}) || exit $?; \ + fi; \ done +dall: + ${MKSUBDIR} dclean: - for i in ${DIRS}; do \ - echo MAKE clean ${BASE}$$i/; \ - (cd $$i && ${MAKE} BASE="${BASE}$$i/" clean) || exit 1; \ - done + ${MKSUBDIR} dinstall: - for i in ${DIRS}; do \ - echo MAKE install ${BASE}$$i/; \ - (cd $$i && ${MAKE} BASE="${BASE}$$i/" install) || exit 1; \ - done + ${MKSUBDIR} +duninstall: + ${MKSUBDIR} ddepend: - for i in ${DIRS}; do \ - echo MAKE depend ${BASE}$$i/; \ - (cd $$i && ${MAKE} BASE="${BASE}$$i/" depend) || exit 1; \ - done + ${MKSUBDIR} all: dall clean: dclean install: dinstall +uninstall: duninstall depend: ddepend diff --git a/mk/hdr.mk b/mk/hdr.mk @@ -1,47 +1,66 @@ .SILENT: -.SUFFIXES: .O .o .c .sh .rc .awk .1 .depend .install .clean +.SUFFIXES: .O .o .c .sh .rc .awk .1 .depend .install .uninstall .clean all: -.c.o: - ${COMPILE} $@ $< - .c.depend: ${DEPEND} $< >>.depend +.c.o: + ${COMPILE} $@ $< + .o.O: ${LINK} $@ $< +.c.O: + ${COMPILE} $@ $< + ${LINK} $@ $< + .awk.O: echo FILTER ${BASE}$< ${FILTER} $< >$@ + chmod 0755 $@ .rc.O: echo FILTER ${BASE}$< ${FILTER} $< >$@ + chmod 0755 $@ .sh.O: echo FILTER ${BASE}$< ${FILTER} $< >$@ + chmod 0755 $@ .O.install: - echo INSTALL $* + echo INSTALL ${BASE}$* cp -f $< ${BIN}/$* chmod 0755 ${BIN}/$* +.O.uninstall: + echo UNINSTALL ${BASE}$* + rm -f ${BIN}/$* .a.install: - echo INSTALL $< + echo INSTALL ${BASE}$< cp -f $< ${LIBDIR}/$< chmod 0644 ${LIBDIR}/$< +.a.uninstall: + echo UNINSTALL ${BASE}$< + rm -f ${LIBDIR}/$< .h.install: - echo INSTALL $< + echo INSTALL ${BASE}$< cp -f $< ${INCLUDE}/$< chmod 0644 ${INCLUDE}/$< +.h.uninstall: + echo UNINSTALL ${BASE}$< + rm -f ${INCLUDE}/$< .1.install: echo INSTALL man $*'(1)' ${FILTER} $< >${MAN}/man1/$< chmod 0644 ${MAN}/man1/$< +.1.uninstall: + echo UNINSTALL man $*'(1)' + rm -f ${MAN}/man1/$< .O.clean: rm $< || true 2>/dev/null @@ -54,6 +73,7 @@ mkdirs: clean: install: printinstall mkdirs +FILTER = cat COMPILE= CC="${CC}" CFLAGS="${CFLAGS} ${EXCFLAGS}" ${ROOT}/util/compile LINK= LD="${LD}" LDFLAGS="${LDFLAGS} ${EXLDFLAGS}" ${ROOT}/util/link diff --git a/mk/lib.mk b/mk/lib.mk @@ -4,6 +4,7 @@ OFILES = ${OBJ:=.o} all: ${HFILES} ${LIB} install: ${TARG}.install +uninstall: ${TARG}.uninstall clean: libclean depend: ${OBJ:=.depend} diff --git a/mk/man.mk b/mk/man.mk @@ -1,4 +1,5 @@ install: ${TARG:.1=.install} +uninstall: ${TARG:.1=.uninstall} printinstall: echo 'Install directories:' diff --git a/mk/many.mk b/mk/many.mk @@ -1,8 +1,9 @@ PROGS = ${TARG:=.O} -all: ${PROGS} +all: ${OFILES} ${PROGS} install: ${TARG:=.install} +uninstall: ${TARG:=.uninstall} clean: manyclean printinstall: @@ -10,8 +11,8 @@ printinstall: echo ' Bin: ${BIN}' manyclean: - for i in ${TARG}; do \ - rm $$i.o; rm $$i.O; \ + for i in ${TARG:=.o} ${TARG:=.O} ${OFILES}; do \ + rm $$i; \ done 2>/dev/null || true include ${ROOT}/mk/common.mk diff --git a/mk/one.mk b/mk/one.mk @@ -4,6 +4,7 @@ OFILES = ${OBJ:=.o} all: ${PROG} install: ${TARG}.install +uninstall: ${TARG}.uninstall clean: oneclean depend: ${OBJ:=.depend}