[PATCH] misc trivial fixes for 1.99.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[please keep me CCed..]
Hi,

Attached are some patches that make the 1.99.5 tarball to compile for
me. It would be nice if somebody could review (and apply) them..
With these patches applied, i could build the abovementioned tarball
against uClibc just fine.

Some patches additionally have a terse description at their top.

PS: It would be nice if you would ship (release-)tarballs with a
configure script.

gpm-1.99.5-missing-return-in-main.patch:

	* src/daemon/old_main.c (old_main): Add return statement to
	function returning an int.

gpm-1.99.5-wrong-include-for-ioctl.patch:

	* src/daemon/open_console.c: Include the proper header for
	ioctl().

gpm-1.99.5-fix-drivers-etouch.patch:

	* src/drivers/etouch/i.c (I_etouch): Fix (possible) segfault.

gpm-1.99.5-susv3-legacy.patch:

	* src/daemon/old_main.c, src/daemon/processconn.c,
	src/lib/liblow.c, src/drivers/synaptics/synaptics.c: bzero() and
	index() are marked as LEGACY in SUSv3; Use their modern
	counterparts.

gpm-1.99.5-conditional-debugstuff.patch:

	* src/prog/gpm-root.y (f_debug_one): Ifdef-out unused function.

gpm-1.99.5-add-install-exec.patch:

	* Makefile.in (install-exec): Add convenience target to match
	default automake automatisms.


diff -rdup gpm-1.99.5.old/src/daemon/old_main.c gpm-1.99.5/src/daemon/old_main.c
--- gpm-1.99.5.old/src/daemon/old_main.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/daemon/old_main.c	2008-04-15 13:25:49.000000000 +0200
@@ -261,4 +261,5 @@ int old_main()
      
      if(pending) gpm_report(GPM_PR_OOPS,GPM_MESS_SELECT_PROB);
    } /* while(1) */
+   return 0;
 }
Only in gpm-1.99.5/src/daemon: old_main.P
Only in gpm-1.99.5/src/daemon: old_main.o
diff -rdup gpm-1.99.5.old3/src/daemon/open_console.c gpm-1.99.5/src/daemon/open_console.c
--- gpm-1.99.5.old3/src/daemon/open_console.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/daemon/open_console.c	2008-04-15 13:30:03.000000000 +0200
@@ -21,7 +21,7 @@
 
 #include <fcntl.h>                  /* open and co.      */
 #include <sys/stat.h>               /* stat()            */
-#include <stropts.h>                /* ioctl             */
+#include <sys/ioctl.h>              /* ioctl()           */
 
 /* Linux specific (to be outsourced in gpm2 */
 #include <linux/serial.h>           /* for serial console check */
Only in gpm-1.99.5/src/daemon: open_console.d
\\\\
\\ drivers/etouch/i.c: In function 'I_etouch':
\\ drivers/etouch/i.c:74: error: array subscript is above array bounds
diff -rdup gpm-1.99.5.old4/src/drivers/etouch/i.c gpm-1.99.5/src/drivers/etouch/i.c
--- gpm-1.99.5.old4/src/drivers/etouch/i.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/drivers/etouch/i.c	2008-04-15 13:32:22.000000000 +0200
@@ -71,7 +71,7 @@ Gpm_Type *I_etouch(int fd, unsigned shor
    for (i=0; i<4; i++)
        if ((gunze_calib[i] & 0xfff) != gunze_calib[i]) calibok = 0;
    if (gunze_calib[0] == gunze_calib[2]) calibok = 0;
-   if (gunze_calib[1] == gunze_calib[4]) calibok = 0;
+   if (gunze_calib[1] == gunze_calib[3]) calibok = 0;
    fclose(f);
   }
   if (!calibok) {
diff -rdup gpm-1.99.5.old/src/daemon/old_main.c gpm-1.99.5/src/daemon/old_main.c
--- gpm-1.99.5.old/src/daemon/old_main.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/daemon/old_main.c	2008-04-15 13:22:49.000000000 +0200
@@ -88,7 +88,7 @@ int old_main()
    /* control node */
 
    if((ctlfd=socket(AF_UNIX,SOCK_STREAM,0))==-1) gpm_report(GPM_PR_OOPS,GPM_MESS_SOCKET_PROB);
-   bzero((char *)&ctladdr,sizeof(ctladdr));
+   memset((char *)&ctladdr, 0, sizeof(ctladdr));
    ctladdr.sun_family=AF_UNIX;
    strcpy(ctladdr.sun_path,GPM_NODE_CTL);
    unlink(GPM_NODE_CTL);
diff -rdup gpm-1.99.5.old/src/daemon/processconn.c gpm-1.99.5/src/daemon/processconn.c
--- gpm-1.99.5.old/src/daemon/processconn.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/daemon/processconn.c	2008-04-15 13:22:37.000000000 +0200
@@ -49,7 +49,7 @@ int processConn(int fd) /* returns newfd
 
 /*....................................... Accept */
 
-   bzero((char *)&addr,sizeof(addr));
+   memset((char *)&addr, 0, sizeof(addr));
    addr.sun_family=AF_UNIX;
 
    len=sizeof(addr);
diff -rdup gpm-1.99.5.old/src/lib/liblow.c gpm-1.99.5/src/lib/liblow.c
--- gpm-1.99.5.old/src/lib/liblow.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/lib/liblow.c	2008-04-15 13:23:15.000000000 +0200
@@ -289,7 +289,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag
       }
 
 #ifndef SO_PEERCRED
-      bzero((char *)&addr,sizeof(addr));
+      memset((char *)&addr, 0, sizeof(addr));
       addr.sun_family=AF_UNIX;
       if (!(sock_name = tempnam (0, "gpm"))) {
          gpm_report(GPM_PR_ERR,GPM_MESS_TEMPNAM,strerror(errno));
@@ -303,7 +303,7 @@ int Gpm_Open(Gpm_Connect *conn, int flag
       }
 #endif
 
-      bzero((char *)&addr,sizeof(addr));
+      memset((char *)&addr, 0, sizeof(addr));
       addr.sun_family=AF_UNIX;
       strcpy(addr.sun_path, GPM_NODE_CTL);
       i=sizeof(addr.sun_family)+strlen(GPM_NODE_CTL);
--- gpm-1.99.5.old5/src/drivers/synaptics/synaptics.c	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/drivers/synaptics/synaptics.c	2008-04-15 13:35:53.000000000 +0200
@@ -2121,9 +2121,9 @@ void tp_read_config_file (char* config_f
 	      break;
 
 	    case Flag_Param:
-	      if (index ("YyTt1", token [0])) {
+	      if (strchr ("YyTt1", token [0])) {
 		*(param_data [param].addr.flag_p) = 1;
-	      } else if (index ("NnFf0", token [0])) {
+	      } else if (strchr ("NnFf0", token [0])) {
 		*(param_data [param].addr.flag_p) = 0;
 	      } else {
 		gpm_report (GPM_PR_WARN,"Flag value (%s) for parameter %s is invalid",
\\\\
\\ src/prog/gpm-root.y:449: error: 'f_debug_one' defined but not used
diff -rdup gpm-1.99.5.old6/src/prog/gpm-root.y gpm-1.99.5/src/prog/gpm-root.y
--- gpm-1.99.5.old6/src/prog/gpm-root.y	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/src/prog/gpm-root.y	2008-04-15 13:40:36.000000000 +0200
@@ -445,6 +445,7 @@ void f__fix(struct passwd *pass)
 }
 
 /*---------------------------------------------------------------------*/
+#ifdef DEBUG
 static int f_debug_one(FILE *f, Draw *draw)
 {
    DrawItem *ip;
@@ -467,6 +468,7 @@ static int f_debug_one(FILE *f, Draw *dr
 #undef LINE
    return 0;
 }
+#endif
 
 int f_debug(int mode, DrawItem *self, int uid)
 {
diff -rdup gpm-1.99.5.old7/Makefile.in gpm-1.99.5/Makefile.in
--- gpm-1.99.5.old7/Makefile.in	2008-04-01 23:43:48.000000000 +0200
+++ gpm-1.99.5/Makefile.in	2008-04-15 13:46:27.000000000 +0200
@@ -44,6 +44,9 @@ install:	check installdirs do-install
 install-strip:
 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install
 
+install-exec: installdirs
+	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' -C src install
+
 installdirs:
 	$(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \
 	if test "x@ELISP@" != "x" ; then \
_______________________________________________
gpm mailing list
gpm@xxxxxxxxxxxxxx
http://lists.linux.it/listinfo/gpm

[Index of Archives]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Gimp]     [Yosemite News]