ksh/ksh93.dif

160 lines
4.2 KiB
Plaintext

--- src/cmd/ksh93/features/options
+++ src/cmd/ksh93/features/options 2007-03-01 17:25:28.000000000 +0100
@@ -35,7 +35,7 @@ tst cross{
option TEST_L $?
test -f /etc/ksh.kshrc -o -f /etc/bash.bashrc &&
option SYSRC 0
- test -f /bin/universe && univ=`/bin/universe` > /dev/null 2>&1 -a ucb = "$univ"
+ test -x /bin/universe && univ=`/bin/universe` > /dev/null 2>&1 && test ucb = "$univ"
option UCB $?
}end
--- src/cmd/ksh93/sh/main.c
+++ src/cmd/ksh93/sh/main.c 2006-04-20 14:56:26.000000000 +0000
@@ -125,9 +125,9 @@
}
#ifdef S_ISSOCK
-#define REMOTE(m) (S_ISSOCK(m)||!(m))
+#define REMOTE(m) ((S_ISSOCK((m).st_mode)||!((m).st_mode))&&!((m).st_ino))
#else
-#define REMOTE(m) !(m)
+#define REMOTE(m) (!((m).st_mode)&&!((m).st_ino))
#endif
int sh_main(int ac, char *av[], void (*userinit)(int))
@@ -192,7 +192,7 @@
}
if(!sh_isoption(SH_RC) && (sh_isoption(SH_BASH) && !sh_isoption(SH_POSIX)
#if SHOPT_REMOTE
- || !fstat(0, &statb) && REMOTE(statb.st_mode)
+ || !fstat(0, &statb) && REMOTE(statb)
#endif
))
sh_onoption(SH_RC);
--- src/cmd/ksh93/sh/suid_exec.c
+++ src/cmd/ksh93/sh/suid_exec.c 2006-03-24 18:49:39.000000000 +0100
@@ -64,7 +64,11 @@
#define THISPROG "/etc/suid_exec"
#define DEFSHELL "/bin/sh"
+#if defined(linux)
+static void error_exit(const char*) __attribute__ ((noreturn));
+#else
static void error_exit(const char*);
+#endif
static int in_dir(const char*, const char*);
static int endsh(const char*);
#ifndef _lib_setregid
--- src/cmd/ksh93/tests/builtins.sh
+++ src/cmd/ksh93/tests/builtins.sh 2007-01-12 16:24:28.000000000 +0000
@@ -310,7 +310,7 @@
(( $? == 1 )) || err_exit "wait not saving exit value"
wait $pid2
(( $? == 127 )) || err_exit "subshell job known to parent"
-if [[ $(foo=bar;foo=$foo exec -c $SHELL -c 'print $foo') != bar ]]
+if [[ $(foo=bar;foo=$foo LD_LIBRARY_PATH=$LD_LIBRARY_PATH exec -c $SHELL -c 'print $foo') != bar ]]
then err_exit '"name=value exec -c ..." not working'
fi
$SHELL -c 'OPTIND=-1000000; getopts a opt -a' 2> /dev/null
--- src/lib/libast/features/align.c
+++ src/lib/libast/features/align.c 2006-03-24 18:50:43.000000000 +0100
@@ -32,6 +32,7 @@
#include "FEATURE/common"
#include <setjmp.h>
+#include <stdio.h>
union _u_
{
--- src/lib/libast/features/botch.c
+++ src/lib/libast/features/botch.c 2006-03-24 18:51:25.000000000 +0100
@@ -27,6 +27,7 @@
* generate ast traps for botched standard prototypes
*/
+#include <stdio.h>
#include <sys/types.h>
#include "FEATURE/lib"
--- src/lib/libast/features/lib
+++ src/lib/libast/features/lib 2007-03-28 13:53:52.417162620 +0200
@@ -491,14 +491,19 @@ tst lib_utime_now note{ utime works with
}end
tst cross{
- u=att
- case `/bin/cat -s /dev/null/foo 2>&1` in
- '') ;;
- *) case `/bin/echo '\\t'` in
- '\t') u=ucb ;;
+ if test -n "$UNIVERSE"
+ then
+ u=$UNIVERSE
+ else
+ u=att
+ case `/bin/cat -s /dev/null/foo 2>&1` in
+ '') ;;
+ *) case `/bin/echo '\\t'` in
+ '\t') u=ucb ;;
+ esac
+ ;;
esac
- ;;
- esac
+ fi
echo "#define _UNIV_DEFAULT \"$u\" /* default universe name */"
}end
--- src/lib/libast/misc/procopen.c
+++ src/lib/libast/misc/procopen.c 2006-03-24 18:49:39.000000000 +0100
@@ -523,7 +523,7 @@
if (!fork())
{
sfsprintf(path, sizeof(path), "%d", getppid());
- execlp("trace", "trace", "-p", path, NiL);
+ execlp("trace", "trace", "-p", path, NULL);
_exit(EXIT_NOTFOUND);
}
sleep(2);
--- src/lib/libast/sfio/sfstrtof.h
+++ src/lib/libast/sfio/sfstrtof.h 2006-03-24 18:49:39.000000000 +0100
@@ -53,7 +53,7 @@
#if !defined(S2F_function)
#define S2F_function _sfdscan
-#define S2F_static 1
+#define S2F_static -1
#define S2F_type 2
#define S2F_scan 1
#ifndef elementsof
--- src/lib/libcmd/chmod.c
+++ src/lib/libcmd/chmod.c 2006-03-24 18:49:39.000000000 +0100
@@ -164,7 +164,7 @@
int (*chmodf)(const char*, mode_t);
int notify = 0;
int ignore = 0;
-#if _lib_lchmod
+#if !defined(linux) && _lib_lchmod
int chlink = 0;
#endif
struct stat st;
@@ -194,7 +194,7 @@
force = 1;
continue;
case 'h':
-#if _lib_lchmod
+#if !defined(linux) && _lib_lchmod
chlink = 1;
#endif
continue;
@@ -248,7 +248,7 @@
}
}
chmodf =
-#if _lib_lchmod
+#if !defined(linux) && _lib_lchmod
chlink ? lchmod :
#endif
chmod;