diff options
author | Eric Sandall | 2007-12-01 01:30:42 -0800 |
---|---|---|
committer | Eric Sandall | 2007-12-01 01:36:16 -0800 |
commit | 7859c9d086db5be7372deb88aea63d6f68bbc31d (patch) | |
tree | 924f6a942ee7e4d736e55abc81f70cf733bdbf3e | |
parent | d152dad5cec09831eb611d48c8d06be01d0ecb2f (diff) |
gpm: Fix compile (Bug #14109)
-rw-r--r-- | utils/gpm/HISTORY | 6 | ||||
-rwxr-xr-x | utils/gpm/PRE_BUILD | 10 | ||||
-rw-r--r-- | utils/gpm/gpm-OPEN_MAX-1.patch | 15 | ||||
-rw-r--r-- | utils/gpm/gpm-OPEN_MAX-2.patch | 14 |
4 files changed, 42 insertions, 3 deletions
diff --git a/utils/gpm/HISTORY b/utils/gpm/HISTORY index ff490ac19d..8a8a29d7a7 100644 --- a/utils/gpm/HISTORY +++ b/utils/gpm/HISTORY @@ -1,3 +1,9 @@ +2007-12-01 Eric Sandall <sandalle@sourcemage.org> + * PRE_BUILD: Apply gpm-OPEN_MAX-1.patch and gpm-OPEN_MAX-2.patch + (Bug #14109) + * gpm-OPEN_MAX-1.patch: Patch from P. Berens to fix Bug #14109 + * gpm-OPEN_MAX-2.patch: Patch from P. Berens to fix Bug #14109 + 2006-07-09 Jaka Kranjc <lynxlynxlynx@sourcemage.org> * CONFIGURE: make the dialogs optional #11598 and clean it up * FINAL: insert default values if none were specified diff --git a/utils/gpm/PRE_BUILD b/utils/gpm/PRE_BUILD index c426d5d0ca..5a905fdfc9 100755 --- a/utils/gpm/PRE_BUILD +++ b/utils/gpm/PRE_BUILD @@ -1,3 +1,7 @@ -default_pre_build && -patch $SOURCE_DIRECTORY/src/lib/liblow.c \ - $SCRIPT_DIRECTORY/gpm.1.20.1-pts.patch +default_pre_build && +patch $SOURCE_DIRECTORY/src/lib/liblow.c \ + $SCRIPT_DIRECTORY/gpm.1.20.1-pts.patch && +patch $SOURCE_DIRECTORY/src/prog/gpm-root.y \ + $SCRIPT_DIRECTORY/gpm-OPEN_MAX-1.patch && +patch $SOURCE_DIRECTORY/src/special.c \ + $SCRIPT_DIRECTORY/gpm-OPEN_MAX-2.patch diff --git a/utils/gpm/gpm-OPEN_MAX-1.patch b/utils/gpm/gpm-OPEN_MAX-1.patch new file mode 100644 index 0000000000..ca5707c5d6 --- /dev/null +++ b/utils/gpm/gpm-OPEN_MAX-1.patch @@ -0,0 +1,15 @@ +diff --git a/src/prog/gpm-root.y b/src/prog/gpm-root.y +index 3a97602..b496550 100644 +--- a/src/prog/gpm-root.y ++++ b/src/prog/gpm-root.y +@@ -526,7 +526,9 @@ int f_bgcmd(int mode, DrawItem *self, int uid) + 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; diff --git a/utils/gpm/gpm-OPEN_MAX-2.patch b/utils/gpm/gpm-OPEN_MAX-2.patch new file mode 100644 index 0000000000..5765e4d056 --- /dev/null +++ b/utils/gpm/gpm-OPEN_MAX-2.patch @@ -0,0 +1,14 @@ +t a/src/special.c b/src/special.c +index 5bed91a..c6cd04d 100644 +--- a/src/special.c ++++ b/src/special.c +@@ -156,7 +156,9 @@ int processSpecial(Gpm_Event *event) + open(GPM_NULL_DEV,O_RDONLY); /* stdin */ + open(console.device, 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 */ |