[oe-commits] org.oe.dev gpm_1.20.1.bb: fix references to OPEN_MAX (Closes: #3762)

jeremy_laine commit oe at amethyst.openembedded.net
Tue May 6 14:15:18 UTC 2008


gpm_1.20.1.bb: fix references to OPEN_MAX (Closes: #3762)

Author: jeremy_laine at openembedded.org
Branch: org.openembedded.dev
Revision: e38c049ff812def90f40369d5fa1ae3f7b818a28
ViewMTN: http://monotone.openembedded.org/revision/info/e38c049ff812def90f40369d5fa1ae3f7b818a28
Files:
1
packages/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch
packages/gpm/gpm_1.20.1.bb
Diffs:

#
# mt diff -r32f83927f371bada65007ff9faed25fd263d6dfd -re38c049ff812def90f40369d5fa1ae3f7b818a28
#
#
#
# add_file "packages/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch"
#  content [57ee880837c22bcccf87a004cd568b457934ac9a]
# 
# patch "packages/gpm/gpm_1.20.1.bb"
#  from [c86e1d07a2d8663df3dd37be659660dbc98765a8]
#    to [86542240789d1a3c5788feac4f60cf57746d3ccd]
#
============================================================
--- packages/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch	57ee880837c22bcccf87a004cd568b457934ac9a
+++ packages/gpm/gpm-1.20.1/gpm-OPEN_MAX.patch	57ee880837c22bcccf87a004cd568b457934ac9a
@@ -0,0 +1,46 @@
+Index: gpm-1.20.1/src/prog/gpm-root.y
+===================================================================
+--- gpm-1.20.1.orig/src/prog/gpm-root.y
++++ gpm-1.20.1/src/prog/gpm-root.y
+@@ -44,7 +44,6 @@
+ #include <sys/stat.h>       /* fstat() */
+ #include <sys/utsname.h>    /* uname() */
+ #include <termios.h>        /* winsize */
+-#include <linux/limits.h>   /* OPEN_MAX */
+ #include <linux/vt.h>       /* VT_ACTIVATE */
+ #include <linux/keyboard.h> /* K_SHIFT */
+ #include <utmp.h>         
+@@ -525,7 +524,9 @@ int f_bgcmd(int mode, DrawItem *self, in
+ 	            open("/dev/null",O_RDONLY); /* stdin  */
+ 	            open(consolename,O_WRONLY); /* stdout */
+ 	            dup(1);                     /* stderr */  
+-	            for (i=3;i<OPEN_MAX; i++) close(i);
++	            int open_max = sysconf(_SC_OPEN_MAX);
++               if (open_max == -1) open_max = 1024;
++               for (i=3;i<open_max; i++) close(i);
+ 	            execl("/bin/sh","sh","-c",self->arg,(char *)NULL);
+ 	            exit(1); /* shouldn't happen */
+ 	         default: return 0;
+Index: gpm-1.20.1/src/special.c
+===================================================================
+--- gpm-1.20.1.orig/src/special.c
++++ gpm-1.20.1/src/special.c
+@@ -25,7 +25,6 @@
+ 
+ /* This file is compiled conditionally, see the Makefile */
+ 
+-#include <linux/limits.h> /* for OPEN_MAX */
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -155,7 +154,9 @@ int processSpecial(Gpm_Event *event)
+       open(GPM_NULL_DEV,O_RDONLY); /* stdin  */
+       open(option.consolename,O_WRONLY); /* stdout */
+       dup(1);                     /* stderr */
+-      for (i=3;i<OPEN_MAX; i++) close(i);
++      int open_max = sysconf(_SC_OPEN_MAX);
++      if (open_max == -1) open_max = 1024;
++      for (i=3;i<open_max; i++) close(i);
+       execl("/bin/sh","sh","-c",command,(char *)NULL);
+       exit(1); /* shouldn't happen */
+       
============================================================
--- packages/gpm/gpm_1.20.1.bb	c86e1d07a2d8663df3dd37be659660dbc98765a8
+++ packages/gpm/gpm_1.20.1.bb	86542240789d1a3c5788feac4f60cf57746d3ccd
@@ -5,12 +5,13 @@ DEPENDS = "ncurses"
 LICENSE = "GPL"
 DEPENDS = "ncurses"
 
-PR = "r2"
+PR = "r3"
 PARALLEL_MAKE = ""
 
 SRC_URI = "ftp://arcana.linux.it/pub/gpm/gpm-${PV}.tar.bz2 \
 	   file://configure.patch;patch=1 \
 	   file://no-docs.patch;patch=1 \
+	   file://gpm-OPEN_MAX.patch;patch=1 \
 	   file://init"
 
 inherit autotools update-rc.d






More information about the Openembedded-commits mailing list