Blame SOURCES/1.20.7...e82d1a653ca94aa4ed12441424da6ce780b1e530.diff

dc81d6
diff --git a/.gitignore b/.gitignore
dc81d6
index 87df93b..5f79b9d 100644
dc81d6
--- a/.gitignore
dc81d6
+++ b/.gitignore
dc81d6
@@ -11,6 +11,7 @@ Makefile
dc81d6
 Makefile.include
dc81d6
 /aclocal.m4
dc81d6
 /autom4te.cache
dc81d6
+/config.cache
dc81d6
 /config.log
dc81d6
 /config.status
dc81d6
 /configure
dc81d6
@@ -29,7 +30,7 @@ Makefile.include
dc81d6
 /src/gpm
dc81d6
 /src/gpm2/tmp
dc81d6
 /src/gpm2/out
dc81d6
-/src/lib/libgpm.so.*
dc81d6
+/src/lib/libgpm.so*
dc81d6
 /src/prog/disable-paste
dc81d6
 /src/prog/display-buttons
dc81d6
 /src/prog/display-coords
dc81d6
diff --git a/Makefile.in b/Makefile.in
dc81d6
index 5412334..0aa6a78 100644
dc81d6
--- a/Makefile.in
dc81d6
+++ b/Makefile.in
dc81d6
@@ -102,19 +102,24 @@ TAGS:	$(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS
dc81d6
 
dc81d6
 ### RELEASE STUFF
dc81d6
 TARS  =../gpm-$(release).tar.gz
dc81d6
-TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma
dc81d6
+TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.xz
dc81d6
 
dc81d6
 M_HOST=arcana.linux.it
dc81d6
 M_DIR=gpm/
dc81d6
 
dc81d6
 tars: $(TARS)
dc81d6
+	chmod a+r $<
dc81d6
 
dc81d6
 # configure headers, produce new configure script
dc81d6
 distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
dc81d6
 
dc81d6
 ../gpm-$(release).tar: $(srcdir) distclean distconf
dc81d6
 	# no exclude possible of .git with pax it seems, so the following is not possible:
dc81d6
-	git archive --prefix "gpm-$(release)/" -o $@ HEAD
dc81d6
+	rm -rf "gpm-$(release)/"
dc81d6
+	git archive --prefix "gpm-$(release)/" HEAD | tar xf -
dc81d6
+	cd "gpm-$(release)/" && ./autogen.sh && rm -rf autom4te.cache
dc81d6
+	tar cf $@ "gpm-$(release)/"
dc81d6
+	rm -rf "gpm-$(release)/"
dc81d6
 
dc81d6
 ../gpm-$(release).tar.gz:  ../gpm-$(release).tar
dc81d6
 	gzip -9 -c $< > $@
dc81d6
@@ -122,11 +127,11 @@ distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
dc81d6
 ../gpm-$(release).tar.bz2:  ../gpm-$(release).tar
dc81d6
 	bzip2 -9 -c $< > $@
dc81d6
 
dc81d6
-../gpm-$(release).tar.lzma:  ../gpm-$(release).tar
dc81d6
-	lzma -9 -c $< > $@
dc81d6
+../gpm-$(release).tar.xz:  ../gpm-$(release).tar
dc81d6
+	xz -9 -c $< > $@
dc81d6
 
dc81d6
 # 3. Put package together into .tar.gz and .tar.bz2
dc81d6
-dist: disttest distclean distconf $(TARS)
dc81d6
+dist: disttest distclean distconf $(TARS) tars
dc81d6
 	scp $(TARS) $(M_HOST):$(M_DIR)
dc81d6
 	mv $(TARS) ~/niconetz/software/gpm/archives
dc81d6
 
dc81d6
diff --git a/configure.ac.footer b/configure.ac.footer
dc81d6
index 89a4cd9..1e5e4da 100644
dc81d6
--- a/configure.ac.footer
dc81d6
+++ b/configure.ac.footer
dc81d6
@@ -124,7 +124,7 @@ No|no|N|n) SHARED_LIBS=-lc ;;
dc81d6
     done
dc81d6
     TERMLIBS=$LIBS
dc81d6
     LIBS=
dc81d6
-    for i in ncurses curses; do
dc81d6
+    for i in ncurses curses ncursesw; do
dc81d6
         if test x$LIBS = x; then
dc81d6
             AC_CHECK_LIB($i, wgetch,,,$TERMLIBS)
dc81d6
         else :; fi
dc81d6
diff --git a/doc/changelog b/doc/changelog
dc81d6
index de64bcf..1581fd1 100644
dc81d6
--- a/doc/changelog
dc81d6
+++ b/doc/changelog
dc81d6
@@ -1,3 +1,7 @@
dc81d6
+1.20.8:
dc81d6
+	* Remove lzma, use xz (Mike Frysinger)
dc81d6
+	* Install shared lib with +x perms (Mike Frysinger)
dc81d6
+
dc81d6
 1.20.7: 2012-10-26
dc81d6
 	* Fix inclusion of unwanted binary data
dc81d6
 	* Even more cleanups (Mike Frysinger)
dc81d6
@@ -5,7 +9,7 @@
dc81d6
 	* Don't build static libgpm by default (Sean McGovern)
dc81d6
 	* autogen.sh is now required to create setup version in autoconf (Nico Schottelius)
dc81d6
 
dc81d6
-1.20.5: 9th of February 2009
dc81d6
+1.20.6: 9th of February 2009
dc81d6
 	* Some cleanups (Mike Frysinger/Nico Schottelius)
dc81d6
 	* Pull in fcntl.h rather than unistd.h for open() (Mike Frysinger)
dc81d6
 	* Fix gcc warning "control reaches end of non-void function" (Mike Frysinger)
dc81d6
diff --git a/doc/doc.gpm.in b/doc/doc.gpm.in
dc81d6
index afd5a29..795b958 100644
dc81d6
--- a/doc/doc.gpm.in
dc81d6
+++ b/doc/doc.gpm.in
dc81d6
@@ -88,7 +88,7 @@ by the Free Software Foundation.
dc81d6
 @subtitle A general purpose mouse server for the Linux console
dc81d6
 @subtitle @value{update-month}
dc81d6
 
dc81d6
-@author by Nico Schottelius <nico@@schottelius.org>
dc81d6
+@author by Nico Schottelius <nico-gpm2008@@schottelius.org>
dc81d6
 
dc81d6
 @end titlepage
dc81d6
 @setchapternewpage off
dc81d6
@@ -525,7 +525,7 @@ security risks when using them.
dc81d6
 Andrew Haylett <ajh@gec-mrc.co.uk> (the original selection code)
dc81d6
 Ian Zimmerman <itz@speakeasy.org> (old maintainer)
dc81d6
 Alessandro Rubini <rubini@linux.it> (old maintainer (still helps a lot))
dc81d6
-Nico Schottelius <nico@schottelius.org> (maintainer)
dc81d6
+Nico Schottelius <nico-gpm2008@schottelius.org> (maintainer)
dc81d6
 
dc81d6
 Many many contributors, to both selection and gpm.
dc81d6
 .fi
dc81d6
diff --git a/src/Makefile.in b/src/Makefile.in
dc81d6
index d3b1dcd..2f92989 100644
dc81d6
--- a/src/Makefile.in
dc81d6
+++ b/src/Makefile.in
dc81d6
@@ -79,7 +79,7 @@ prog/%:	prog/%.o
dc81d6
 #		| $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@'
dc81d6
 
dc81d6
 # Do it all!
dc81d6
-all:	gpm lib/libgpm.so.@abi_lev@ @LIBGPM_A@ $(PROG)
dc81d6
+all:	gpm lib/libgpm.so.@abi_lev@ lib/libgpm.so @LIBGPM_A@ $(PROG)
dc81d6
 
dc81d6
 gpm:	$(GOBJ)
dc81d6
 	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
dc81d6
@@ -96,7 +96,7 @@ $(DEPFILE) dep: prog/gpm-root.c
dc81d6
 
dc81d6
 	# create dependencies
dc81d6
 	for DEPS in `echo *.c */*.c`; do \
dc81d6
-	$(CC) -I. -I $(srcdir) -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
dc81d6
+	$(CC) -I. -I $(srcdir) -I $(srcdir)/headers -M @CPPFLAGS@ $(CPPFLAGS) $$DEPS | \
dc81d6
 	$(SED) 's/^\(.*\)\.o\([ :]+\)/\1.o \1.lo\2/g' >> $(DEPFILE) ; done
dc81d6
 
dc81d6
 ### INSTALL
dc81d6
@@ -113,7 +113,7 @@ install:	check
dc81d6
 	# 2.x goes along; unfortunately that means an additional
dc81d6
 	# headache in cases like this
dc81d6
 	if test "x@SHLIB@" != "x" ; then \
dc81d6
-		$(INSTALL_DATA) -m 644 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@	;	\
dc81d6
+		$(INSTALL_DATA) -m 755 lib/libgpm.so.@abi_full@ $(libdir)/libgpm.so.@abi_full@	;	\
dc81d6
 		cd $(libdir) && $(LN_S) -f libgpm.so.@abi_full@ libgpm.so.@abi_lev@ 					;	\
dc81d6
       echo "WARNING: We installed a lib, you should now call ldconfig" 						; 	\
dc81d6
       echo "f.i.: ldconfig -n -l $(libdir)/libgpm.so.@abi_full@" 								;	\
dc81d6
@@ -168,9 +168,8 @@ lib/libgpm.so.@abi_full@:	$(PICS)
dc81d6
 	@LDFLAGS@ $(LDFLAGS) -o lib/libgpm.so.@abi_full@ $^ @LIBS@ @SHARED_LIBS@ $(LIBS)	
dc81d6
 lib/libgpm.so.@abi_lev@:	lib/libgpm.so.@abi_full@
dc81d6
 	$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so.@abi_lev@
dc81d6
-# unneeded, isn't it?
dc81d6
-#lib/libgpm.so:	lib/libgpm.so.@abi_full@
dc81d6
-#	$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so
dc81d6
+lib/libgpm.so:	lib/libgpm.so.@abi_full@
dc81d6
+	$(LN_S) -f libgpm.so.@abi_full@ lib/libgpm.so
dc81d6
 
dc81d6
 include $(DEPFILE)
dc81d6
 
dc81d6
diff --git a/src/daemon/gpm.c b/src/daemon/gpm.c
dc81d6
index 771da5c..6806dce 100644
dc81d6
--- a/src/daemon/gpm.c
dc81d6
+++ b/src/daemon/gpm.c
dc81d6
@@ -29,7 +29,7 @@
dc81d6
 #include <signal.h>        /* SIGPIPE */
dc81d6
 #include <time.h>          /* time() */
dc81d6
 #include <sys/param.h>
dc81d6
-#include <sys/fcntl.h>     /* O_RDONLY */
dc81d6
+#include <fcntl.h>         /* O_RDONLY */
dc81d6
 #include <sys/wait.h>      /* wait()   */
dc81d6
 #include <sys/stat.h>      /* mkdir()  */
dc81d6
 #include <sys/time.h>      /* timeval */
dc81d6
diff --git a/src/daemon/old_main.c b/src/daemon/old_main.c
dc81d6
index 9cd4e56..ab7a87f 100644
dc81d6
--- a/src/daemon/old_main.c
dc81d6
+++ b/src/daemon/old_main.c
dc81d6
@@ -25,6 +25,7 @@
dc81d6
 #include <signal.h>                 /* guess again       */
dc81d6
 #include <errno.h>                  /* guess again       */
dc81d6
 #include <unistd.h>                 /* unlink            */
dc81d6
+#include <string.h>                 /* strcpy, bzero     */
dc81d6
 #include <sys/stat.h>               /* chmod             */
dc81d6
 
dc81d6
 #include <linux/kd.h>               /* linux hd*         */
dc81d6
@@ -192,10 +193,11 @@ int old_main()
dc81d6
                 * or to the default handler, if any
dc81d6
                 * or to the selection handler
dc81d6
                 */ /* FIXME -- check event.vc */
dc81d6
-               /* can't we please rewrite the following a bit nicer?*/
dc81d6
-               (cinfo[event.vc] && do_client(cinfo[event.vc], &event))
dc81d6
-               || (cinfo[0]        && do_client(cinfo[0],        &event))
dc81d6
-               ||  do_selection(&event);
dc81d6
+               if(!cinfo[event.vc] || !do_client(cinfo[event.vc], &event)) {
dc81d6
+                    if(!cinfo[0] || !do_client(cinfo[0],&event)) {
dc81d6
+                        do_selection(&event);
dc81d6
+                    }
dc81d6
+	       }
dc81d6
             }
dc81d6
       }
dc81d6
 
dc81d6
diff --git a/src/daemon/open_console.c b/src/daemon/open_console.c
dc81d6
index 98297c9..6dd43e6 100644
dc81d6
--- a/src/daemon/open_console.c
dc81d6
+++ b/src/daemon/open_console.c
dc81d6
@@ -21,8 +21,13 @@
dc81d6
 
dc81d6
 #include <fcntl.h>                  /* open and co.      */
dc81d6
 #include <sys/stat.h>               /* stat()            */
dc81d6
+#include <sys/types.h>              /* major()           */
dc81d6
 #include <sys/ioctl.h>              /* ioctl             */
dc81d6
 
dc81d6
+#ifdef HAVE_SYS_SYSMACROS_H
dc81d6
+#include <sys/sysmacros.h>          /* major() w/newer glibc */
dc81d6
+#endif
dc81d6
+
dc81d6
 /* Linux specific (to be outsourced in gpm2 */
dc81d6
 #include <linux/serial.h>           /* for serial console check */
dc81d6
 #include <asm/ioctls.h>            /* for serial console check */
dc81d6
diff --git a/src/daemon/processconn.c b/src/daemon/processconn.c
dc81d6
index a5839a3..e92fa63 100644
dc81d6
--- a/src/daemon/processconn.c
dc81d6
+++ b/src/daemon/processconn.c
dc81d6
@@ -67,7 +67,8 @@ int processConn(int fd)
dc81d6
       return -1;
dc81d6
    }
dc81d6
 
dc81d6
-   if((vc = request->vc) > MAX_VC) {
dc81d6
+   vc = request->vc;
dc81d6
+   if(vc > MAX_VC || vc < 0) {
dc81d6
       gpm_report(GPM_PR_DEBUG, GPM_MESS_REQUEST_ON, vc, MAX_VC);
dc81d6
       free(info);
dc81d6
       close(newfd);
dc81d6
diff --git a/src/headers/daemon.h b/src/headers/daemon.h
dc81d6
index a8936ad..24a1a97 100644
dc81d6
--- a/src/headers/daemon.h
dc81d6
+++ b/src/headers/daemon.h
dc81d6
@@ -180,7 +180,7 @@ extern struct mouse_features  mouse_table[3],
dc81d6
 extern Gpm_Type         mice[];
dc81d6
 extern Gpm_Type         *repeated_type;
dc81d6
 
dc81d6
-time_t                  last_selection_time;
dc81d6
+extern time_t           last_selection_time;
dc81d6
 
dc81d6
 
dc81d6
 
dc81d6
diff --git a/src/headers/gpm.h b/src/headers/gpm.h
dc81d6
index 57dc618..fe52e53 100644
dc81d6
--- a/src/headers/gpm.h
dc81d6
+++ b/src/headers/gpm.h
dc81d6
@@ -280,10 +280,16 @@ int   Gpm_GetSnapshot(Gpm_Event *ePtr);
dc81d6
 char *Gpm_get_console( void );
dc81d6
 int Gpm_x_high_y(int base, int pot_y);
dc81d6
 int Gpm_cnt_digits(int number);
dc81d6
-void gpm_oops(int line, char *file, char *text, ... );
dc81d6
+#ifdef __GNUC__
dc81d6
+__attribute__((__format__(printf, 3, 4)))
dc81d6
+#endif
dc81d6
+void gpm_oops(int line, const char *file, const char *text, ... );
dc81d6
 
dc81d6
 /* report.c / report-lib.c */
dc81d6
-void gpm_report(int line, char *file, int stat, char *text, ... );
dc81d6
+#ifdef __GNUC__
dc81d6
+__attribute__((__format__(printf, 4, 5)))
dc81d6
+#endif
dc81d6
+void gpm_report(int line, const char *file, int stat, const char *text, ... );
dc81d6
 
dc81d6
 #ifdef __cplusplus
dc81d6
   };
dc81d6
diff --git a/src/headers/message.h b/src/headers/message.h
dc81d6
index a0fed0e..4b60291 100644
dc81d6
--- a/src/headers/message.h
dc81d6
+++ b/src/headers/message.h
dc81d6
@@ -226,7 +226,10 @@
dc81d6
 /* #define GPM_MESS_                   "" */
dc81d6
 
dc81d6
 /* functions */
dc81d6
-void gpm_report(int line, char *file, int stat, char *text, ... );
dc81d6
+#ifdef __GNUC__
dc81d6
+__attribute__((__format__(printf, 4, 5)))
dc81d6
+#endif
dc81d6
+void gpm_report(int line, const char *file, int stat, const char *text, ... );
dc81d6
 
dc81d6
 /* rest of wd.h */
dc81d6
 #ifdef HAVE_SYSLOG_H
dc81d6
diff --git a/src/lib/liblow.c b/src/lib/liblow.c
dc81d6
index e789d09..8b40b71 100644
dc81d6
--- a/src/lib/liblow.c
dc81d6
+++ b/src/lib/liblow.c
dc81d6
@@ -29,11 +29,12 @@
dc81d6
 #include <string.h>        /* strncmp */
dc81d6
 #include <unistd.h>        /* select(); */
dc81d6
 #include <errno.h>
dc81d6
+#include <fcntl.h>         /* O_RDONLY */
dc81d6
+
dc81d6
 #include <sys/time.h>      /* timeval */
dc81d6
 #include <sys/types.h>     /* socket() */
dc81d6
 #include <sys/socket.h>    /* socket() */
dc81d6
 #include <sys/un.h>        /* struct sockaddr_un */
dc81d6
-#include <sys/fcntl.h>     /* O_RDONLY */
dc81d6
 #include <sys/stat.h>      /* stat() */
dc81d6
 
dc81d6
 #ifdef  SIGTSTP         /* true if BSD system */
dc81d6
@@ -173,7 +174,7 @@ static void gpm_suspend_hook (int signum)
dc81d6
   /* Reincarnation. Prepare for another death early. */
dc81d6
   sigemptyset(&sa.sa_mask);
dc81d6
   sa.sa_handler = gpm_suspend_hook;
dc81d6
-  sa.sa_flags = SA_NOMASK;
dc81d6
+  sa.sa_flags = SA_NODEFER;
dc81d6
   sigaction (SIGTSTP, &sa, 0);
dc81d6
 
dc81d6
   /* Pop the gpm stack by closing the useless connection */
dc81d6
@@ -364,7 +365,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag)
dc81d6
 
dc81d6
          /* if signal was originally ignored, job control is not supported */
dc81d6
          if (gpm_saved_suspend_hook.sa_handler != SIG_IGN) {
dc81d6
-            sa.sa_flags = SA_NOMASK;
dc81d6
+            sa.sa_flags = SA_NODEFER;
dc81d6
             sa.sa_handler = gpm_suspend_hook;
dc81d6
             sigaction(SIGTSTP, &sa, 0);
dc81d6
          }
dc81d6
diff --git a/src/lib/report-lib.c b/src/lib/report-lib.c
dc81d6
index c0ae086..03230b4 100644
dc81d6
--- a/src/lib/report-lib.c
dc81d6
+++ b/src/lib/report-lib.c
dc81d6
@@ -24,9 +24,9 @@
dc81d6
 
dc81d6
 #include "headers/message.h"
dc81d6
 
dc81d6
-void gpm_report(int line, char *file, int stat, char *text, ... )
dc81d6
+void gpm_report(int line, const char *file, int stat, const char *text, ... )
dc81d6
 {
dc81d6
-   char *string = NULL;
dc81d6
+   const char *string = NULL;
dc81d6
    int log_level;
dc81d6
    va_list ap;
dc81d6
 
dc81d6
@@ -47,7 +47,7 @@ void gpm_report(int line, char *file, int stat, char *text, ... )
dc81d6
                            log_level = LOG_CRIT; break;
dc81d6
    }
dc81d6
 #ifdef HAVE_VSYSLOG
dc81d6
-   syslog(log_level, string);
dc81d6
+   syslog(log_level, "%s", string);
dc81d6
    vsyslog(log_level, text, ap);
dc81d6
 #else
dc81d6
    fprintf(stderr,"%s[%s(%d)]:\n",string,file,line);
dc81d6
diff --git a/src/prog/display-buttons.c b/src/prog/display-buttons.c
dc81d6
index de8e5b2..38d2f11 100644
dc81d6
--- a/src/prog/display-buttons.c
dc81d6
+++ b/src/prog/display-buttons.c
dc81d6
@@ -36,6 +36,7 @@
dc81d6
 #include <stdio.h>            /* printf()             */
dc81d6
 #include <time.h>             /* time()               */
dc81d6
 #include <errno.h>            /* errno                */
dc81d6
+#include <sys/select.h>       /* fd_set and FD_*      */
dc81d6
 #include <gpm.h>              /* gpm information      */
dc81d6
 
dc81d6
 /* display resulting data */
dc81d6
diff --git a/src/prog/display-coords.c b/src/prog/display-coords.c
dc81d6
index ed15c8a..82afd12 100644
dc81d6
--- a/src/prog/display-coords.c
dc81d6
+++ b/src/prog/display-coords.c
dc81d6
@@ -33,10 +33,12 @@
dc81d6
  */
dc81d6
 
dc81d6
 #include <unistd.h>           /* write, read, open    */
dc81d6
+#include <stdint.h>
dc81d6
 #include <stdlib.h>           /* strtol()             */
dc81d6
 #include <stdio.h>            /* printf()             */
dc81d6
 #include <time.h>             /* time()               */
dc81d6
 #include <errno.h>            /* errno                */
dc81d6
+#include <sys/select.h>       /* fd_set and FD_*      */
dc81d6
 #include <gpm.h>              /* gpm information      */
dc81d6
 
dc81d6
 /* display resulting data */
dc81d6
@@ -50,7 +52,7 @@ int display_data(Gpm_Event *event, void *data)
dc81d6
    last  = now;
dc81d6
 
dc81d6
    /* display time, delta time */
dc81d6
-   printf("[%d] delta: %ds",now,delta);
dc81d6
+   printf("[%jd] delta: %ds",(intmax_t)now,delta);
dc81d6
    
dc81d6
    /* display mouse information */
dc81d6
    printf(": x=%2i, y=%2i, dx=%2i, dy=%2i\n", event->x, event->y, event->dx, event->dy);
dc81d6
diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y
dc81d6
index 069d801..76c896c 100644
dc81d6
--- a/src/prog/gpm-root.y
dc81d6
+++ b/src/prog/gpm-root.y
dc81d6
@@ -443,6 +443,7 @@ void f__fix(struct passwd *pass)
dc81d6
 }
dc81d6
 
dc81d6
 /*---------------------------------------------------------------------*/
dc81d6
+#if 0
dc81d6
 static int f_debug_one(FILE *f, Draw *draw)
dc81d6
 {
dc81d6
    DrawItem *ip;
dc81d6
@@ -465,6 +466,7 @@ static int f_debug_one(FILE *f, Draw *draw)
dc81d6
 #undef LINE
dc81d6
    return 0;
dc81d6
 }
dc81d6
+#endif
dc81d6
 
dc81d6
 int f_debug(int mode, DrawItem *self, int uid)
dc81d6
 {
dc81d6
@@ -960,10 +962,8 @@ static inline void scr_dump(int fd, FILE *f, unsigned char *buffer, int vc)
dc81d6
 /*------------*/
dc81d6
 static inline void scr_restore(int fd, FILE *f, unsigned char *buffer, int vc)
dc81d6
 {
dc81d6
-   int x,y, dumpfd;
dc81d6
+   int dumpfd;
dc81d6
    char dumpname[20];
dc81d6
-
dc81d6
-   x=buffer[2]; y=buffer[3];
dc81d6
    
dc81d6
    /* WILL NOT WORK WITH DEVFS! FIXME! */
dc81d6
    sprintf(dumpname,"/dev/vcsa%i",vc);
dc81d6
@@ -1196,12 +1196,8 @@ int main(int argc, char **argv)
dc81d6
                                                         LOG_DAEMON : LOG_USER);
dc81d6
    /* reap your zombies */
dc81d6
    childaction.sa_handler=reap_children;
dc81d6
-#if defined(__GLIBC__)
dc81d6
-   __sigemptyset(&childaction.sa_mask);
dc81d6
-#else /* __GLIBC__ */
dc81d6
-   childaction.sa_mask=0;
dc81d6
-#endif /* __GLIBC__ */
dc81d6
-   childaction.sa_flags=SA_INTERRUPT; /* need to break the select() call */
dc81d6
+   sigemptyset(&childaction.sa_mask);
dc81d6
+   childaction.sa_flags=0;
dc81d6
    sigaction(SIGCHLD,&childaction,NULL);
dc81d6
 
dc81d6
    /*....................................... Connect and get your buffer */
dc81d6
diff --git a/src/prog/mouse-test.c b/src/prog/mouse-test.c
dc81d6
index 0bb1982..d7d1027 100644
dc81d6
--- a/src/prog/mouse-test.c
dc81d6
+++ b/src/prog/mouse-test.c
dc81d6
@@ -182,14 +182,14 @@ Gpm_Type *(*I_serial)(int fd, unsigned short flags, struct Gpm_Type *type,
dc81d6
 /*----------------------------------------------------------------------------- 
dc81d6
    Place the description here.
dc81d6
  -----------------------------------------------------------------------------*/
dc81d6
-int mousereopen(int oldfd, char *name, Gpm_Type *type)
dc81d6
+int mousereopen(int oldfd, const char *name, Gpm_Type *type)
dc81d6
 {
dc81d6
    int fd;
dc81d6
    if (!type) type=mice+1; /* ms */
dc81d6
    close(oldfd);
dc81d6
    usleep(100000);
dc81d6
    fd=open(name,O_RDWR);
dc81d6
-   if (fd < 0) gpm_report(GPM_PR_OOPS,name);
dc81d6
+   if (fd < 0) gpm_report(GPM_PR_OOPS, "%s", name);
dc81d6
    (*I_serial)(fd,type->flags,type,1,&type->name); /* ms initialization */
dc81d6
    return fd;
dc81d6
 }
dc81d6
diff --git a/src/report.c b/src/report.c
dc81d6
index 6c7c2ee..286c1b7 100644
dc81d6
--- a/src/report.c
dc81d6
+++ b/src/report.c
dc81d6
@@ -69,7 +69,7 @@
dc81d6
  *
dc81d6
  */
dc81d6
 
dc81d6
-void gpm_report(int line, char *file, int stat, char *text, ... )
dc81d6
+void gpm_report(int line, const char *file, int stat, const char *text, ...)
dc81d6
 {
dc81d6
    FILE *console = NULL;
dc81d6
    va_list ap, ap3;
dc81d6
diff --git a/src/synaptics.c b/src/synaptics.c
dc81d6
index 2418c75..a978ef0 100644
dc81d6
--- a/src/synaptics.c
dc81d6
+++ b/src/synaptics.c
dc81d6
@@ -214,6 +214,7 @@
dc81d6
 #include <stdlib.h>
dc81d6
 #include <unistd.h>
dc81d6
 #include <string.h>
dc81d6
+#include <limits.h>
dc81d6
 #include <sys/time.h>
dc81d6
 #include <sys/ioctl.h>
dc81d6
 
dc81d6
@@ -2241,8 +2242,7 @@ static void syn_process_config (info_type ident,
dc81d6
 
dc81d6
 
dc81d6
 
dc81d6
-static unsigned char tp_hextoint (unsigned char byte1,
dc81d6
-				  unsigned char byte2) 
dc81d6
+static unsigned char tp_hextoint (unsigned byte1,unsigned byte2) 
dc81d6
 {
dc81d6
   unsigned char bytes [3];
dc81d6
   int result;
dc81d6
@@ -2250,7 +2250,7 @@ static unsigned char tp_hextoint (unsigned char byte1,
dc81d6
   bytes [0] = byte1;
dc81d6
   bytes [1] = byte2;
dc81d6
   bytes [2] = '\0';
dc81d6
-  sscanf (bytes, "%x", &result);
dc81d6
+  sscanf ((char *)bytes, "%x", &result);
dc81d6
   return result;
dc81d6
 }
dc81d6
 
dc81d6
@@ -2311,8 +2311,7 @@ static void tp_serial_read (int fd,
dc81d6
 }
dc81d6
 
dc81d6
 /* Write a string of commands */
dc81d6
-static void tp_serial_send_cmd(int fd,
dc81d6
-			       unsigned char *cmd) 
dc81d6
+static void tp_serial_send_cmd(int fd, const char *cmd) 
dc81d6
 {
dc81d6
   unsigned char junk [15];
dc81d6
 
dc81d6
@@ -2329,7 +2328,7 @@ static void tp_serial_send_cmd(int fd,
dc81d6
 static void syn_serial_set_mode (int fd,
dc81d6
 				 unsigned char mode) 
dc81d6
 {
dc81d6
-  unsigned char bytes [15];
dc81d6
+  char bytes [15];
dc81d6
 
dc81d6
   sprintf (bytes, "%%C3B%02X5555", mode);
dc81d6
 #if DEBUG_SENT_DATA
dc81d6
diff --git a/src/twiddler.c b/src/twiddler.c
dc81d6
index 1d2bd50..972a616 100644
dc81d6
--- a/src/twiddler.c
dc81d6
+++ b/src/twiddler.c
dc81d6
@@ -250,7 +250,6 @@ static inline int twiddler_use_item(char *item)
dc81d6
 int twiddler_key(unsigned long message)
dc81d6
 {
dc81d6
    char **table = twiddler_get_table(message);
dc81d6
-   char *val;
dc81d6
   /*
dc81d6
    * These two are needed to avoid transmitting single keys when typing
dc81d6
    * chords. When the number of keys being held down decreases, data
dc81d6
@@ -269,7 +268,6 @@ int twiddler_key(unsigned long message)
dc81d6
 
dc81d6
    if (!table) return 0;
dc81d6
    message &= 0xff;
dc81d6
-   val = table[message];
dc81d6
 
dc81d6
    if ((message < last_message) && !marked) { /* ok, do it */
dc81d6
       marked++; /* don't retransmit on release */
dc81d6
@@ -428,8 +426,11 @@ char *twiddler_rest_to_value(char *s)
dc81d6
       buf[ibuf]='\0';
dc81d6
       return strdup(buf);
dc81d6
    }
dc81d6
-   if (*ptr == '\\')
dc81d6
-      return (char *)twiddler_escape_sequence(ptr+1, &len /* unused */);
dc81d6
+   if (*ptr == '\\') {
dc81d6
+      buf[ibuf++] = twiddler_escape_sequence(ptr+1, &len /* unused */);
dc81d6
+      buf[ibuf] = '\0';
dc81d6
+      return strdup(buf);
dc81d6
+   }
dc81d6
 
dc81d6
    if (strlen(ptr)==1) return ((char *)((unsigned long)*ptr & 0xFF));
dc81d6