r1708 - in trunk

stsp at dslinux.in-berlin.de stsp at dslinux.in-berlin.de
Fri Apr 13 21:24:11 CEST 2007


Author: stsp
Date: 2007-04-13 21:24:06 +0200 (Fri, 13 Apr 2007)
New Revision: 1708

Log:
Adding port of gpm-1.20.1 by Troy Davis (GPF).
Thanks :-)


Modified: trunk/config/Configure.help
===================================================================
--- trunk/config/Configure.help	2007-04-13 17:50:33 UTC (rev 1707)
+++ trunk/config/Configure.help	2007-04-13 19:24:06 UTC (rev 1708)
@@ -447,6 +447,10 @@
   server. (old version - mk68k targets only)
   Approx. binary size: 14k
 
+CONFIG_USER_GPM_GPM
+  The General Purpose Mouse daemon.
+  With this daemon you can use the mouse on the DSLinux console.
+
 CONFIG_USER_GREP_GREP
   GNU grep, egrep and fgrep
 

Modified: trunk/config/config.in
===================================================================
--- trunk/config/config.in	2007-04-13 17:50:33 UTC (rev 1707)
+++ trunk/config/config.in	2007-04-13 19:24:06 UTC (rev 1708)
@@ -773,6 +773,7 @@
 bool 'gdbserver'		CONFIG_USER_GDB_GDBSERVER
 bool 'gdbreplay (old)'		CONFIG_USER_GDBSERVER_GDBREPLAY
 bool 'gdbserver (old)'		CONFIG_USER_GDBSERVER_GDBSERVER
+bool 'gpm'			CONFIG_USER_GPM_GPM
 bool 'grep'			CONFIG_USER_GREP_GREP
 bool 'hd'			CONFIG_USER_HD_HD
 bool 'hexedit'			CONFIG_USER_HEXEDIT_HEXEDIT

Modified: trunk/include/Makefile
===================================================================
--- trunk/include/Makefile	2007-04-13 17:50:33 UTC (rev 1707)
+++ trunk/include/Makefile	2007-04-13 19:24:06 UTC (rev 1708)
@@ -58,7 +58,8 @@
 	$(ROOTDIR)/modules/ocf/cryptodev.h,crypto \
 	$(ROOTDIR)/prop/smgrd/unixware/cmd/sscep/sscep_error_codes.h,. \
 	$(ROOTDIR)/lib/libid3tag/id3tag.h,. \
-	$(ROOTDIR)/lib/libmad/mad.h,. 
+	$(ROOTDIR)/lib/libmad/mad.h,. \
+	$(ROOTDIR)/user/gpm/src/headers/gpm.h,.
 
 
 #

Modified: trunk/lib/Makefile
===================================================================
--- trunk/lib/Makefile	2007-04-13 17:50:33 UTC (rev 1707)
+++ trunk/lib/Makefile	2007-04-13 19:24:06 UTC (rev 1708)
@@ -173,7 +173,8 @@
 	$(ROOTDIR)/lib/flex/build/*.a \
 	$(ROOTDIR)/lib/libgmp/*.a  \
 	$(ROOTDIR)/lib/libid3tag/*.a \
-	$(ROOTDIR)/lib/libmad/*.a 
+	$(ROOTDIR)/lib/libmad/*.a \
+	$(ROOTDIR)/user/gpm/src/lib/*.a
 
 ##############################################################################
 

Modified: trunk/lib/libpng/Makefile
===================================================================
--- trunk/lib/libpng/Makefile	2007-04-13 17:50:33 UTC (rev 1707)
+++ trunk/lib/libpng/Makefile	2007-04-13 19:24:06 UTC (rev 1708)
@@ -52,7 +52,7 @@
 	$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
 
 #all: libpng.a libpng.so pngtest
-all: libpng.a libpng.so
+all: libpng.a
 
 libpng.a: $(OBJS)
 	ar rc $@ $(OBJS)

Copied: trunk/user/gpm (from rev 1706, tags/gpm/gpm-1.20.1/user/gpm)

Added: trunk/user/gpm/Makefile

Added: trunk/user/gpm/Makefile.include

Added: trunk/user/gpm/src/Makefile

Modified: trunk/user/gpm/src/gpm.c
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/gpm.c	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/gpm.c	2007-04-13 19:24:06 UTC (rev 1708)
@@ -971,7 +971,7 @@
 
    len=sizeof(ctladdr.sun_family)+strlen(GPM_NODE_CTL);
    if(bind(ctlfd,(struct sockaddr *)(&ctladdr),len) == -1)
-      gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,ctladdr.sun_path);
+      gpm_report(GPM_PR_OOPS,GPM_MESS_BIND_PROB,GPM_NODE_CTL);
    maxfd=max(maxfd,ctlfd);
 
    /* needs to be 0777, so all users can _try_ to access gpm */

Added: trunk/user/gpm/src/headers/config.h

Modified: trunk/user/gpm/src/headers/gpm.h
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/headers/gpm.h	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/headers/gpm.h	2007-04-13 19:24:06 UTC (rev 1708)
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef _PATH_DEV
-#define _PATH_DEV	"/dev/"
+#define _PATH_DEV	"/var/run/" /* /dev/ is read-only on DSLinux*/
 #endif
 
 #define GPM_NODE_DIR      _PATH_VARRUN

Modified: trunk/user/gpm/src/headers/gpmInt.h
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/headers/gpmInt.h	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/headers/gpmInt.h	2007-04-13 19:24:06 UTC (rev 1708)
@@ -227,7 +227,7 @@
 };
 
 /* global variables */
-struct options option;        /* one should be enough for us */
+extern struct options option;        /* one should be enough for us */
 
 /* new variables </CLEAN> */
 

Modified: trunk/user/gpm/src/lib/liblow.c
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/lib/liblow.c	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/lib/liblow.c	2007-04-13 19:24:06 UTC (rev 1708)
@@ -49,6 +49,8 @@
 #include "headers/gpmInt.h"
 #include "headers/message.h"
 
+struct options option;        /* one should be enough for us */
+
 #ifndef min
 #define min(a,b) ((a)<(b) ? (a) : (b))
 #define max(a,b) ((a)>(b) ? (a) : (b))
@@ -201,7 +203,7 @@
 
    option.consolename = NULL;
 
-   gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
+   //gpm_report(GPM_PR_DEBUG,"VC: %d",flag);
 
    /*....................................... First of all, check xterm */
 
@@ -257,13 +259,13 @@
             gpm_report(GPM_PR_ERR,"checking tty name failed");
             goto err;
          }   
-         /* do we really need this check ? */
+         /* do we really need this check ? 
          if(strncmp(tty,option.consolename,strlen(option.consolename)-1)
             || !isdigit(tty[strlen(option.consolename)-1])) {
             gpm_report(GPM_PR_ERR,"strncmp/isdigit/option.consolename failed");
             goto err;
          }
-          
+          nope :)*/
          conn->vc=atoi(&tty[strlen(option.consolename)-1]);
       }
 

Modified: trunk/user/gpm/src/main.c
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/main.c	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/main.c	2007-04-13 19:24:06 UTC (rev 1708)
@@ -26,7 +26,7 @@
 
 
 #include "headers/gpmInt.h"
-
+struct options option;        /* one should be enough for us */
 int main(int argc, char **argv)
 {
    startup(argc,argv);  /* setup configurations */

Modified: trunk/user/gpm/src/special.c
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/special.c	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/special.c	2007-04-13 19:24:06 UTC (rev 1708)
@@ -144,10 +144,10 @@
   fprintf(consolef,"\"%s\"\n",command);
   if (consolef!=stderr) fclose(consolef);
 
-  switch(fork())
+  switch(vfork())
     {
     case -1: /* error */
-      fprintf(stderr,"%s: fork(): %s\n", option.progname, strerror(errno));
+      fprintf(stderr,"%s: vfork(): %s\n", option.progname, strerror(errno));
       return 0; /* Hmmm.... error */
     
     case 0: /* child */

Modified: trunk/user/gpm/src/startup.c
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/startup.c	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/startup.c	2007-04-13 19:24:06 UTC (rev 1708)
@@ -136,7 +136,7 @@
 
    if(option.run_status == GPM_RUN_STARTUP ) { /* else is debugging */
       /* goto background and become a session leader (Stefan Giessler) */  
-      switch(fork()) {
+      switch(vfork()) {
          case -1: gpm_report(GPM_PR_OOPS,GPM_MESS_FORK_FAILED);   /* error  */
          case  0: option.run_status = GPM_RUN_DAEMON; break;      /* child  */
          default: _exit(0);                                       /* parent */

Modified: trunk/user/gpm/src/twiddler.c
===================================================================
--- tags/gpm/gpm-1.20.1/user/gpm/src/twiddler.c	2007-04-13 17:39:48 UTC (rev 1706)
+++ trunk/user/gpm/src/twiddler.c	2007-04-13 19:24:06 UTC (rev 1708)
@@ -176,7 +176,7 @@
 {
    int pid;
    extern struct options option;
-   switch(pid=fork()) {
+   switch(pid=vfork()) {
       case -1: return -1;
       case 0:
          close(0);




More information about the dslinux-commit mailing list