Browse Source

zsh: Fix bogus nice() warning (#1151)

android-5
Fredrik Fornwall 8 years ago
parent
commit
b4b0cc1875
  1. 36
      packages/zsh/Src-exec.c.patch
  2. 2
      packages/zsh/build.sh
  3. 21
      packages/zsh/exec_bin_sh.patch

36
packages/zsh/Src-exec.c.patch

@ -0,0 +1,36 @@
diff -u -r ../zsh-5.3/Src/exec.c ./Src/exec.c
--- ../zsh-5.3/Src/exec.c 2016-12-06 20:21:39.000000000 +0100
+++ ./Src/exec.c 2017-07-21 00:51:47.226997418 +0200
@@ -518,7 +518,7 @@
} else if (eno == ENOEXEC) {
argv[-1] = "sh";
winch_unblock();
- execve("/bin/sh", argv - 1, newenvp);
+ execve("@TERMUX_PREFIX@/bin/sh", argv - 1, newenvp);
}
} else if (eno == ENOEXEC) {
for (t0 = 0; t0 != ct; t0++)
@@ -527,7 +527,7 @@
if (t0 == ct) {
argv[-1] = "sh";
winch_unblock();
- execve("/bin/sh", argv - 1, newenvp);
+ execve("@TERMUX_PREFIX@/bin/sh", argv - 1, newenvp);
}
}
} else
@@ -3295,9 +3295,12 @@
holdintr();
#ifdef HAVE_NICE
/* Check if we should run background jobs at a lower priority. */
- if ((how & Z_ASYNC) && isset(BGNICE))
- if (nice(5) < 0)
+ if ((how & Z_ASYNC) && isset(BGNICE)) {
+ errno = 0;
+ nice(5);
+ if (errno != 0)
zwarn("nice(5) failed: %e", errno);
+ }
#endif /* HAVE_NICE */
} else if (is_cursh) {

2
packages/zsh/build.sh

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.zsh.org
TERMUX_PKG_DESCRIPTION="Shell with lots of features"
_FOLDERVERSION=5.3
TERMUX_PKG_VERSION=${_FOLDERVERSION}.1
TERMUX_PKG_REVISION=2
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/zsh/zsh/$_FOLDERVERSION/zsh-${_FOLDERVERSION}.tar.xz
TERMUX_PKG_SHA256=76f82cfd5ce373cf799a03b6f395283f128430db49202e3e3f512fb5a19d6f8a
TERMUX_PKG_RM_AFTER_INSTALL="bin/zsh-${_FOLDERVERSION}"

21
packages/zsh/exec_bin_sh.patch

@ -1,21 +0,0 @@
diff -u -r ../zsh-5.0.5/Src/exec.c ./Src/exec.c
--- ../zsh-5.0.5/Src/exec.c 2014-01-02 18:34:49.000000000 +0100
+++ ./Src/exec.c 2014-02-03 02:51:11.000000000 +0100
@@ -508,7 +508,7 @@
} else if (eno == ENOEXEC) {
argv[-1] = "sh";
winch_unblock();
- execve("/bin/sh", argv - 1, newenvp);
+ execve("@TERMUX_PREFIX@/bin/sh", argv - 1, newenvp);
}
} else if (eno == ENOEXEC) {
for (t0 = 0; t0 != ct; t0++)
@@ -517,7 +517,7 @@
if (t0 == ct) {
argv[-1] = "sh";
winch_unblock();
- execve("/bin/sh", argv - 1, newenvp);
+ execve("@TERMUX_PREFIX@/bin/sh", argv - 1, newenvp);
}
}
} else
Loading…
Cancel
Save