[hackers] [libixp] Fixed some bugs.

From: Kris Maglione <jg_AT_suckless.org>
Date: Mon Mar 26 20:29:22 2007

changeset: 51:eab22a7c80a3
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Mar 26 14:27:29 2007 -0400
summary: Fixed some bugs.

diff -r 7aaf9de91d48 -r eab22a7c80a3 libixp/convert.c
--- a/libixp/convert.c Mon Mar 26 00:49:25 2007 -0400
+++ b/libixp/convert.c Mon Mar 26 14:27:29 2007 -0400
@@ -132,11 +132,13 @@ ixp_pstrings(Message *msg, ushort *num,
                 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 -r 7aaf9de91d48 -r eab22a7c80a3 libixp/request.c
--- a/libixp/request.c Mon Mar 26 00:49:25 2007 -0400
+++ b/libixp/request.c Mon Mar 26 14:27:29 2007 -0400
@@ -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 -r 7aaf9de91d48 -r eab22a7c80a3 man/Makefile
--- a/man/Makefile Mon Mar 26 00:49:25 2007 -0400
+++ b/man/Makefile Mon Mar 26 14:27:29 2007 -0400
@@ -3,6 +3,4 @@ include ${ROOT}/mk/hdr.mk
 
 TARG = ixpc.1
 
-FILTER = cat
-
 include ${ROOT}/mk/man.mk
diff -r 7aaf9de91d48 -r eab22a7c80a3 mk/common.mk
--- a/mk/common.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/common.mk Mon Mar 26 14:27:29 2007 -0400
@@ -11,6 +11,7 @@ mkdirs:
         done
 
 install: ${HFILES:.h=.install}
+uninstall: ${HFILES:.h=.uninstall}
 
 cleandep:
         rm .depend 2>/dev/null || true
diff -r 7aaf9de91d48 -r eab22a7c80a3 mk/dir.mk
--- a/mk/dir.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/dir.mk Mon Mar 26 14:27:29 2007 -0400
@@ -1,25 +1,25 @@ dall:
+MKSUBDIR = targ=$@; \
+ for i in ${DIRS}; do \
+ 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:
- for i in ${DIRS}; do \
- echo MAKE all ${BASE}$$i/; \
- (cd $$i && ${MAKE} BASE="${BASE}$$i/" all) || exit 1; \
- done
+ ${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 -r 7aaf9de91d48 -r eab22a7c80a3 mk/hdr.mk
--- a/mk/hdr.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/hdr.mk Mon Mar 26 14:27:29 2007 -0400
@@ -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.depend:
+ ${DEPEND} $< >>.depend
 
 .c.o:
         ${COMPILE} $@ $<
 
-.c.depend:
- ${DEPEND} $< >>.depend
+.o.O:
+ ${LINK} $@ $<
 
-.o.O:
+.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 @@ clean:
 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 -r 7aaf9de91d48 -r eab22a7c80a3 mk/lib.mk
--- a/mk/lib.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/lib.mk Mon Mar 26 14:27:29 2007 -0400
@@ -4,6 +4,7 @@ all: ${HFILES} ${LIB}
 all: ${HFILES} ${LIB}
 
 install: ${TARG}.install
+uninstall: ${TARG}.uninstall
 clean: libclean
 depend: ${OBJ:=.depend}
 
diff -r 7aaf9de91d48 -r eab22a7c80a3 mk/man.mk
--- a/mk/man.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/man.mk Mon Mar 26 14:27:29 2007 -0400
@@ -1,4 +1,5 @@ install: ${TARG:.1=.install}
 install: ${TARG:.1=.install}
+uninstall: ${TARG:.1=.uninstall}
 
 printinstall:
         echo 'Install directories:'
diff -r 7aaf9de91d48 -r eab22a7c80a3 mk/many.mk
--- a/mk/many.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/many.mk Mon Mar 26 14:27:29 2007 -0400
@@ -1,8 +1,9 @@ PROGS = ${TARG:=.O}
 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 -r 7aaf9de91d48 -r eab22a7c80a3 mk/one.mk
--- a/mk/one.mk Mon Mar 26 00:49:25 2007 -0400
+++ b/mk/one.mk Mon Mar 26 14:27:29 2007 -0400
@@ -4,6 +4,7 @@ all: ${PROG}
 all: ${PROG}
 
 install: ${TARG}.install
+uninstall: ${TARG}.uninstall
 clean: oneclean
 depend: ${OBJ:=.depend}
 
Received on Mon Mar 26 2007 - 20:29:22 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:26 UTC