Accepting request 205892 from shells
Automatic submission by obs-autosubmit OBS-URL: https://build.opensuse.org/request/show/205892 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ksh?expand=0&rev=96
This commit is contained in:
commit
598f6e2ec0
27
ksh.changes
27
ksh.changes
@ -1,3 +1,30 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 25 14:07:57 UTC 2013 - werner@suse.de
|
||||||
|
|
||||||
|
- Add missing sfsetbuf() in patch ksh93-fdstatus.dif
|
||||||
|
- Rework patch ksh93-dttree-crash.dif
|
||||||
|
- Rework patch ksh93-uninitialized.dif
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 22 11:58:21 UTC 2013 - werner@suse.de
|
||||||
|
|
||||||
|
- Change patch ksh93-fdstatus.dif by adding some more EINTR wrapper
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 18 12:21:58 UTC 2013 - werner@suse.de
|
||||||
|
|
||||||
|
- Add patch ksh93-sfio.dif as on overlapping memory areas there
|
||||||
|
should memmove be used instead of memcopy (backport 2013-10-10)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 18 10:41:05 UTC 2013 - werner@suse.de
|
||||||
|
|
||||||
|
- Change patch ksh93-fdstatus.dif which may solve bnc#844071
|
||||||
|
- Add patch ksh93-fs3d.dif to avoid crash due dummy function call
|
||||||
|
fs3d_mount(3ast) during valgrind sessions
|
||||||
|
- Add patch ksh93-uninitialized.dif to avoid sometimes random
|
||||||
|
errors on busy systems which may also related to bnc#844071
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 19 08:43:37 UTC 2013 - werner@suse.de
|
Thu Sep 19 08:43:37 UTC 2013 - werner@suse.de
|
||||||
|
|
||||||
|
30
ksh.spec
30
ksh.spec
@ -129,6 +129,12 @@ Patch32: ksh93-heredoclex.dif
|
|||||||
Patch33: ksh93-fdstatus.dif
|
Patch33: ksh93-fdstatus.dif
|
||||||
# PATCH-FIX-UPSTREAM ksh93-alias-k.dif [bnc#824187]
|
# PATCH-FIX-UPSTREAM ksh93-alias-k.dif [bnc#824187]
|
||||||
Patch34: ksh93-alias-k.dif
|
Patch34: ksh93-alias-k.dif
|
||||||
|
# PATCH-FIX-SUSE Reduce warnings about uninitialized varaibles (most of them are handled correct)
|
||||||
|
Patch35: ksh93-uninitialized.dif
|
||||||
|
# PATCH-FIX-SUSE Do not use mount(2) system call instead of fs3d_mount(3ast)
|
||||||
|
Patch36: ksh93-fs3d.dif
|
||||||
|
# PATCH-FIX-UPSTREAM Ouch ... use memmove instead of memcopy on overlapping areas
|
||||||
|
Patch37: ksh93-sfio.dif
|
||||||
Patch42: ksh-locale.patch
|
Patch42: ksh-locale.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -217,6 +223,9 @@ fi
|
|||||||
%patch32
|
%patch32
|
||||||
%patch33
|
%patch33
|
||||||
%patch34
|
%patch34
|
||||||
|
%patch35
|
||||||
|
%patch36
|
||||||
|
%patch37
|
||||||
|
|
||||||
%build
|
%build
|
||||||
#
|
#
|
||||||
@ -245,9 +254,6 @@ fi
|
|||||||
test -s $fd -a ! -c $fd && break || true
|
test -s $fd -a ! -c $fd && break || true
|
||||||
done
|
done
|
||||||
set -- $(readlink $fd)
|
set -- $(readlink $fd)
|
||||||
grep pts /proc/mounts
|
|
||||||
ls -ld /dev/ptmx
|
|
||||||
ls -ld /dev/pts
|
|
||||||
exec ./sigexec $SHELL ${1+"$@"}
|
exec ./sigexec $SHELL ${1+"$@"}
|
||||||
fi
|
fi
|
||||||
IGNORED=0x$(ps --no-headers -o ignored $$)
|
IGNORED=0x$(ps --no-headers -o ignored $$)
|
||||||
@ -324,6 +330,7 @@ ls -ld /dev/pts
|
|||||||
cflags -Wno-implicit IGNORE
|
cflags -Wno-implicit IGNORE
|
||||||
cflags -Wno-unused-value IGNORE
|
cflags -Wno-unused-value IGNORE
|
||||||
cflags -Wno-type-limits IGNORE
|
cflags -Wno-type-limits IGNORE
|
||||||
|
cflags -Wclobbered RPM_OPT_FLAGS
|
||||||
#
|
#
|
||||||
# Do not use -DSHOPT_SPAWN=1 and/or -DSHOPT_AMP=1 this would cause
|
# Do not use -DSHOPT_SPAWN=1 and/or -DSHOPT_AMP=1 this would cause
|
||||||
# errors due race conditions while executing the test suite.
|
# errors due race conditions while executing the test suite.
|
||||||
@ -466,7 +473,7 @@ ls -ld /dev/pts
|
|||||||
done
|
done
|
||||||
nobuiltin=${PWD}/.nobuiltin
|
nobuiltin=${PWD}/.nobuiltin
|
||||||
nm -D ${root}/lib/libast.so | \
|
nm -D ${root}/lib/libast.so | \
|
||||||
grep -E 'T[[:blank:]](_ast_)?(str|mem|(get|put|set)env|(c|m|re|v)alloc)' | \
|
grep -E 'T[[:blank:]](_ast_)?(str|mem|(get|put|set)env|free|(c|m|re|v|vm)alloc)' | \
|
||||||
sed -r 's/[[:xdigit:]]+[[:blank:]]+T[[:blank:]]+(_ast_)?([^[:blank:]]*)/-fno-builtin-\2/' | \
|
sed -r 's/[[:xdigit:]]+[[:blank:]]+T[[:blank:]]+(_ast_)?([^[:blank:]]*)/-fno-builtin-\2/' | \
|
||||||
sort -u > $nobuiltin
|
sort -u > $nobuiltin
|
||||||
rm -rf $root
|
rm -rf $root
|
||||||
@ -481,7 +488,7 @@ ls -ld /dev/pts
|
|||||||
*) cflags @$nobuiltin RPM_OPT_FLAGS
|
*) cflags @$nobuiltin RPM_OPT_FLAGS
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export > .env
|
export | grep -vE 'PROFILEREAD|PWD|MAIL|HOME|HOST|HIST|LESS|TMP' > .env
|
||||||
bin/package make CCFLAGS="$RPM_OPT_FLAGS -I${root}/include" HOSTTYPE="$HOSTTYPE" AR="$AR" CC="$CC"
|
bin/package make CCFLAGS="$RPM_OPT_FLAGS -I${root}/include" HOSTTYPE="$HOSTTYPE" AR="$AR" CC="$CC"
|
||||||
root=$(echo ${PWD}/arch/linux*)
|
root=$(echo ${PWD}/arch/linux*)
|
||||||
test -d $root || exit 1
|
test -d $root || exit 1
|
||||||
@ -535,7 +542,16 @@ ls -ld /dev/pts
|
|||||||
sed -ri '/^L[[:blank:]]/a \t 8000' pty.sh
|
sed -ri '/^L[[:blank:]]/a \t 8000' pty.sh
|
||||||
sed -ri 's/(SECONDS[[:blank:]]*>[[:blank:]]*)([[:digit:]]+)/\18/' signal.sh
|
sed -ri 's/(SECONDS[[:blank:]]*>[[:blank:]]*)([[:digit:]]+)/\18/' signal.sh
|
||||||
unset ${!LESS*}
|
unset ${!LESS*}
|
||||||
|
printf '\033[1m'
|
||||||
|
grep -E '^(model name|flags)[[:blank:]]*:' /proc/cpuinfo | sort -ur | fold -s
|
||||||
|
printf '\033(B\033[m'
|
||||||
${SHELL} shtests
|
${SHELL} shtests
|
||||||
|
result=$(${SHELL} -k -c 'd=`/bin/echo x y=z`; echo $d x y=z')
|
||||||
|
test "$result" = 'x x' || exit 1
|
||||||
|
result=$(${SHELL} -c 'echo | echo "x`/bin/echo y`"')
|
||||||
|
test "$result" = xy || exit 1
|
||||||
|
result=$(${SHELL} -c 'echo | echo "x$(/bin/echo y)"')
|
||||||
|
test "$result" = xy || exit 1
|
||||||
exec 3> ${TMPDIR:-/tmp}/log
|
exec 3> ${TMPDIR:-/tmp}/log
|
||||||
LANG=POSIX
|
LANG=POSIX
|
||||||
strace $MEMORY -o '!%{S:31}' ${SHELL} %{S:10} 400
|
strace $MEMORY -o '!%{S:31}' ${SHELL} %{S:10} 400
|
||||||
@ -567,7 +583,9 @@ ls -ld /dev/pts
|
|||||||
fi
|
fi
|
||||||
LANG=POSIX
|
LANG=POSIX
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
|
printf '\033[1m'
|
||||||
uniq -c ${TMPDIR:-/tmp}/log
|
uniq -c ${TMPDIR:-/tmp}/log
|
||||||
|
printf '\033(B\033[m'
|
||||||
killall -q -s 9 ${SHELL} || true
|
killall -q -s 9 ${SHELL} || true
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
@ -704,7 +722,7 @@ ls -ld /dev/pts
|
|||||||
else
|
else
|
||||||
cp %{S:3} EPL-1.0
|
cp %{S:3} EPL-1.0
|
||||||
cp %{S:4} CPL-1.0
|
cp %{S:4} CPL-1.0
|
||||||
ln -sf EPL-v1.0 LICENSE
|
ln -sf EPL-1.0 LICENSE
|
||||||
fi
|
fi
|
||||||
mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm
|
mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm
|
||||||
echo '.VERBON 22' > grep.mm
|
echo '.VERBON 22' > grep.mm
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- src/cmd/builtin/pty.c
|
--- src/cmd/builtin/pty.c
|
||||||
+++ src/cmd/builtin/pty.c 2013-02-01 15:59:52.697952156 +0000
|
+++ src/cmd/builtin/pty.c 2013-02-01 15:59:52.697952156 +0000
|
||||||
@@ -216,13 +216,19 @@ mkpty(int* master, int* slave)
|
@@ -216,27 +216,64 @@ mkpty(int* master, int* slave)
|
||||||
#if !_lib_openpty
|
#if !_lib_openpty
|
||||||
char* sname;
|
char* sname;
|
||||||
#endif
|
#endif
|
||||||
@ -17,34 +17,64 @@
|
|||||||
|
|
||||||
- alarm(4);
|
- alarm(4);
|
||||||
- if (tcgetattr(STDERR_FILENO, &tty) >= 0)
|
- if (tcgetattr(STDERR_FILENO, &tty) >= 0)
|
||||||
|
- ttyp = &tty;
|
||||||
|
- else
|
||||||
+ alarm(6);
|
+ alarm(6);
|
||||||
+ if (tcgetattr(sffileno(sfstderr), &tty) >= 0)
|
+ if (tcgetattr(sffileno(sfstderr), &tty) < 0)
|
||||||
ttyp = &tty;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
@@ -230,7 +236,7 @@ mkpty(int* master, int* slave)
|
+ if (errno != ENOTTY)
|
||||||
error(-1, "unable to get standard error terminal attributes");
|
+ error(-1, "unable to get standard error terminal attributes");
|
||||||
|
+ cfmakeraw(&tty);
|
||||||
|
ttyp = 0;
|
||||||
|
- error(-1, "unable to get standard error terminal attributes");
|
||||||
}
|
}
|
||||||
|
+ tty.c_lflag |= ICANON | IEXTEN | ISIG | ECHO|ECHOE|ECHOK|ECHOKE;
|
||||||
|
+ tty.c_oflag |= (ONLCR | OPOST);
|
||||||
|
+ tty.c_oflag &= ~(OCRNL | ONLRET);
|
||||||
|
+ tty.c_iflag |= BRKINT;
|
||||||
|
+ tty.c_iflag &= ~IGNBRK;
|
||||||
|
+ tty.c_lflag |= ISIG;
|
||||||
|
+ tty.c_cc[VTIME] = 0;
|
||||||
|
+ tty.c_cc[VMIN] = CMIN;
|
||||||
|
+#ifdef B115200
|
||||||
|
+ cfsetispeed(&tty, B115200);
|
||||||
|
+ cfsetospeed(&tty, B115200);
|
||||||
|
+#elif defined(B57600)
|
||||||
|
+ cfsetispeed(&tty, B57600);
|
||||||
|
+ cfsetospeed(&tty, B57600);
|
||||||
|
+#elif defined(B38400)
|
||||||
|
+ cfsetispeed(&tty, B38400);
|
||||||
|
+ cfsetospeed(&tty, B38400);
|
||||||
|
+#endif
|
||||||
|
+ ttyp = &tty;
|
||||||
#ifdef TIOCGWINSZ
|
#ifdef TIOCGWINSZ
|
||||||
- if (ioctl(STDERR_FILENO, TIOCGWINSZ, &win) >= 0)
|
- if (ioctl(STDERR_FILENO, TIOCGWINSZ, &win) >= 0)
|
||||||
+ if (ioctl(sffileno(sfstderr), TIOCGWINSZ, &win) >= 0)
|
- winp = &win;
|
||||||
winp = &win;
|
- else
|
||||||
else
|
+ if (ioctl(sffileno(sfstderr), TIOCGWINSZ, &win) < 0)
|
||||||
{
|
{
|
||||||
@@ -238,6 +244,12 @@ mkpty(int* master, int* slave)
|
+ if (errno != ENOTTY)
|
||||||
error(-1, "unable to get standard error window size");
|
+ error(-1, "unable to get standard error window size");
|
||||||
|
+ win.ws_row = 0;
|
||||||
|
+ win.ws_col = 0;
|
||||||
|
winp = 0;
|
||||||
|
- error(-1, "unable to get standard error window size");
|
||||||
}
|
}
|
||||||
#endif
|
+ if (win.ws_row < 24)
|
||||||
|
+ win.ws_row = 24;
|
||||||
|
+ if (win.ws_col < 80)
|
||||||
|
+ win.ws_col = 80;
|
||||||
|
+ winp = &win;
|
||||||
|
+#endif
|
||||||
+#ifdef __linux__
|
+#ifdef __linux__
|
||||||
+# if !_lib_openpty
|
+# if !_lib_openpty
|
||||||
+# undef _lib_openpty
|
+# undef _lib_openpty
|
||||||
+# define _lib_openpty 1
|
+# define _lib_openpty 1
|
||||||
+# endif
|
+# endif
|
||||||
+#endif
|
#endif
|
||||||
#if _lib_openpty
|
#if _lib_openpty
|
||||||
if (openpty(master, slave, NULL, ttyp, winp) < 0)
|
if (openpty(master, slave, NULL, ttyp, winp) < 0)
|
||||||
return -1;
|
@@ -279,6 +316,9 @@ mkpty(int* master, int* slave)
|
||||||
@@ -279,6 +291,9 @@ mkpty(int* master, int* slave)
|
|
||||||
#if !O_cloexec
|
#if !O_cloexec
|
||||||
fcntl(*slave, F_SETFD, FD_CLOEXEC);
|
fcntl(*slave, F_SETFD, FD_CLOEXEC);
|
||||||
#endif
|
#endif
|
||||||
@ -54,7 +84,7 @@
|
|||||||
alarm(0);
|
alarm(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -317,9 +332,13 @@ process(Sfio_t* mp, Sfio_t* lp, int dela
|
@@ -317,9 +357,13 @@ process(Sfio_t* mp, Sfio_t* lp, int dela
|
||||||
char* s;
|
char* s;
|
||||||
Sfio_t* ip;
|
Sfio_t* ip;
|
||||||
Sfio_t* sps[2];
|
Sfio_t* sps[2];
|
||||||
@ -69,7 +99,7 @@
|
|||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
t = timeout;
|
t = timeout;
|
||||||
@@ -336,39 +355,39 @@ process(Sfio_t* mp, Sfio_t* lp, int dela
|
@@ -336,39 +380,39 @@ process(Sfio_t* mp, Sfio_t* lp, int dela
|
||||||
{
|
{
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
error(ERROR_SYSTEM|2, "poll failed");
|
error(ERROR_SYSTEM|2, "poll failed");
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
shp->fpathdict = dtopen(&_Rpdisc,Dtobag);
|
shp->fpathdict = dtopen(&_Rpdisc,Dtobag);
|
||||||
- if(shp->fpathdict)
|
- if(shp->fpathdict)
|
||||||
+ if(shp->fpathdict) {
|
+ if(shp->fpathdict) {
|
||||||
+ dtuserdata(shp->fpathdict,shp,1);
|
+ /* dtuserdata(shp->fpathdict,shp,1); */
|
||||||
dtinsert(shp->fpathdict,rp);
|
dtinsert(shp->fpathdict,rp);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
|
1245
ksh93-fdstatus.dif
1245
ksh93-fdstatus.dif
File diff suppressed because it is too large
Load Diff
65
ksh93-fs3d.dif
Normal file
65
ksh93-fs3d.dif
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
2013-10-17 10:30:20 - werner@suse.de
|
||||||
|
|
||||||
|
Found by debugging with valgrind and environment variable LD_LIBRARY_PATH that
|
||||||
|
the mount() system call function from the glibc is used instead of a fs3d_mount()
|
||||||
|
function. To avoid this make fs3d_mount() a weak symbol to be overloadable by
|
||||||
|
a shared library function and make the stub function return -1 for not configured
|
||||||
|
file system type.
|
||||||
|
|
||||||
|
--- src/lib/libast/misc/fs3d.c
|
||||||
|
+++ src/lib/libast/misc/fs3d.c 2013-10-17 10:30:20.000000000 +0000
|
||||||
|
@@ -28,6 +28,20 @@
|
||||||
|
* only active for non-shared 3d library
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#if defined(__linux__) && defined(__GNUC__)
|
||||||
|
+# if defined __USE_ISOC99
|
||||||
|
+# define _cat_pragma(exp) _Pragma(#exp)
|
||||||
|
+# define _weak_pragma(exp) _cat_pragma(weak name)
|
||||||
|
+# else
|
||||||
|
+# define _weak_pragma(exp)
|
||||||
|
+# endif
|
||||||
|
+# define _declare(name,sym) __extension__ extern __typeof__(sym) name
|
||||||
|
+# define weak_symbol(sym) _weak_pragma(name) _declare(sym,sym) __attribute__((__weak__))
|
||||||
|
+# include <error.h>
|
||||||
|
+#else
|
||||||
|
+# define weak_symbol(sym)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#define mount ______mount
|
||||||
|
|
||||||
|
#include <ast.h>
|
||||||
|
@@ -35,6 +49,7 @@
|
||||||
|
#undef mount
|
||||||
|
|
||||||
|
#include <fs3d.h>
|
||||||
|
+weak_symbol(fs3d_mount);
|
||||||
|
|
||||||
|
int
|
||||||
|
fs3d(register int op)
|
||||||
|
@@ -102,11 +117,18 @@ fs3d(register int op)
|
||||||
|
* user code that includes <fs3d.h> will have mount() mapped to fs3d_mount()
|
||||||
|
* this restricts the various "standard" mount prototype conflicts to this spot
|
||||||
|
* this means that code that includes <fs3d.h> cannot access the real mount
|
||||||
|
- * (at least without some additional macro hackery
|
||||||
|
+ * (at least without some additional macro hackery)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef mount
|
||||||
|
-
|
||||||
|
+#if defined(__linux__) && defined(__GNUC__)
|
||||||
|
+int __attribute__((__noinline__))
|
||||||
|
+fs3d_mount(const char* source, char* target, int flags, void* data)
|
||||||
|
+{
|
||||||
|
+ errno = ENODEV;
|
||||||
|
+ return -1;
|
||||||
|
+}
|
||||||
|
+#else
|
||||||
|
extern int mount(const char*, char*, int, void*);
|
||||||
|
|
||||||
|
int
|
||||||
|
@@ -114,3 +136,4 @@ fs3d_mount(const char* source, char* tar
|
||||||
|
{
|
||||||
|
return mount(source, target, flags, data);
|
||||||
|
}
|
||||||
|
+#endif
|
263
ksh93-sfio.dif
Normal file
263
ksh93-sfio.dif
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
--- src/lib/libast/include/sfio_t.h
|
||||||
|
+++ src/lib/libast/include/sfio_t.h 2013-10-11 09:22:41.000000000 +0000
|
||||||
|
@@ -34,7 +34,7 @@
|
||||||
|
#define _SFIO_PRIVATE \
|
||||||
|
Sfoff_t extent; /* current file size */ \
|
||||||
|
Sfoff_t here; /* current physical location */ \
|
||||||
|
- unsigned char unused_1;/* unused #1 */ \
|
||||||
|
+ unsigned char ngetr; /* sfgetr count */ \
|
||||||
|
unsigned char tiny[1];/* for unbuffered read stream */ \
|
||||||
|
unsigned short bits; /* private flags */ \
|
||||||
|
unsigned int mode; /* current io mode */ \
|
||||||
|
@@ -82,7 +82,7 @@
|
||||||
|
(ssize_t)(-1), /* val */ \
|
||||||
|
(Sfoff_t)0, /* extent */ \
|
||||||
|
(Sfoff_t)0, /* here */ \
|
||||||
|
- 0, /* getr */ \
|
||||||
|
+ 0, /* ngetr */ \
|
||||||
|
{0}, /* tiny */ \
|
||||||
|
0, /* bits */ \
|
||||||
|
(unsigned int)(((type)&(SF_RDWR))|SF_INIT), /* mode */ \
|
||||||
|
@@ -93,7 +93,8 @@
|
||||||
|
(mutex), /* mutex */ \
|
||||||
|
(Void_t*)0, /* stdio */ \
|
||||||
|
(Sfoff_t)0, /* lpos */ \
|
||||||
|
- (size_t)0 /* iosz */ \
|
||||||
|
+ (size_t)0, /* iosz */ \
|
||||||
|
+ 0 /* getr */ \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* function to clear an Sfio_t structure */
|
||||||
|
@@ -110,7 +111,7 @@
|
||||||
|
(f)->val = (ssize_t)(-1), /* val */ \
|
||||||
|
(f)->extent = (Sfoff_t)(-1), /* extent */ \
|
||||||
|
(f)->here = (Sfoff_t)0, /* here */ \
|
||||||
|
- (f)->getr = 0, /* getr */ \
|
||||||
|
+ (f)->ngetr = 0, /* ngetr */ \
|
||||||
|
(f)->tiny[0] = 0, /* tiny */ \
|
||||||
|
(f)->bits = 0, /* bits */ \
|
||||||
|
(f)->mode = 0, /* mode */ \
|
||||||
|
@@ -121,7 +122,8 @@
|
||||||
|
(f)->mutex = (mtx), /* mutex */ \
|
||||||
|
(f)->stdio = (Void_t*)0, /* stdio */ \
|
||||||
|
(f)->lpos = (Sfoff_t)0, /* lpos */ \
|
||||||
|
- (f)->iosz = (size_t)0 /* iosz */ \
|
||||||
|
+ (f)->iosz = (size_t)0, /* iosz */ \
|
||||||
|
+ (f)->getr = 0 /* getr */ \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* expose next stream inside discipline function; state saved in int f */
|
||||||
|
--- src/lib/libast/sfio/sfflsbuf.c
|
||||||
|
+++ src/lib/libast/sfio/sfflsbuf.c 2013-10-18 11:50:01.866235555 +0000
|
||||||
|
@@ -96,7 +96,7 @@ int c; /* if c>=0, c is also written out
|
||||||
|
isall = SFISALL(f,isall);
|
||||||
|
if((w = SFWR(f,data,n,f->disc)) > 0)
|
||||||
|
{ if((n -= w) > 0) /* save unwritten data, then resume */
|
||||||
|
- memcpy((char*)f->data,(char*)data+w,n);
|
||||||
|
+ memmove((char*)f->data,(char*)data+w,n);
|
||||||
|
written += w;
|
||||||
|
f->next = f->data+n;
|
||||||
|
if(c < 0 && (!isall || n == 0))
|
||||||
|
--- src/lib/libast/sfio/sfmode.c
|
||||||
|
+++ src/lib/libast/sfio/sfmode.c 2013-10-11 09:26:43.000000000 +0000
|
||||||
|
@@ -258,7 +258,7 @@ reg Sfio_t* f; /* stream to close */
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
Sfproc_t* p;
|
||||||
|
- int pid, status;
|
||||||
|
+ int status;
|
||||||
|
|
||||||
|
if(!(p = f->proc))
|
||||||
|
return -1;
|
||||||
|
@@ -279,7 +279,7 @@ reg Sfio_t* f; /* stream to close */
|
||||||
|
sigcritical(SIG_REG_EXEC|SIG_REG_PROC);
|
||||||
|
#endif
|
||||||
|
status = -1;
|
||||||
|
- while ((pid = waitpid(p->pid,&status,0)) == -1 && errno == EINTR)
|
||||||
|
+ while (waitpid(p->pid,&status,0) == -1 && errno == EINTR)
|
||||||
|
;
|
||||||
|
#if _PACKAGE_ast
|
||||||
|
status = status == -1 ?
|
||||||
|
@@ -405,12 +405,16 @@ reg int local; /* a local call */
|
||||||
|
if(f->mode&SF_GETR)
|
||||||
|
{ f->mode &= ~SF_GETR;
|
||||||
|
#ifdef MAP_TYPE
|
||||||
|
- if((f->bits&SF_MMAP) && (f->tiny[0] += 1) >= (4*SF_NMAP) )
|
||||||
|
- { /* turn off mmap to avoid page faulting */
|
||||||
|
- sfsetbuf(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);
|
||||||
|
- f->tiny[0] = 0;
|
||||||
|
+ if(f->bits&SF_MMAP)
|
||||||
|
+ {
|
||||||
|
+ if (!++f->ngetr)
|
||||||
|
+ f->tiny[0]++;
|
||||||
|
+ if(((f->tiny[0]<<8)|f->ngetr) >= (4*SF_NMAP) )
|
||||||
|
+ { /* turn off mmap to avoid page faulting */
|
||||||
|
+ sfsetbuf(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);
|
||||||
|
+ f->ngetr = f->tiny[0] = 0;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
- else
|
||||||
|
#endif
|
||||||
|
if(f->getr)
|
||||||
|
{ f->next[-1] = f->getr;
|
||||||
|
--- src/lib/libast/sfio/sfmove.c
|
||||||
|
+++ src/lib/libast/sfio/sfmove.c 2013-10-18 12:04:03.194735625 +0000
|
||||||
|
@@ -113,7 +113,11 @@ reg int rc; /* record separator */
|
||||||
|
|
||||||
|
/* try reading a block of data */
|
||||||
|
direct = 0;
|
||||||
|
- if((r = fr->endb - (next = fr->next)) <= 0)
|
||||||
|
+ if(fr->rsrv && (r = -fr->rsrv->slen) > 0)
|
||||||
|
+ { fr->rsrv->slen = 0;
|
||||||
|
+ next = fr->rsrv->data;
|
||||||
|
+ }
|
||||||
|
+ else if((r = fr->endb - (next = fr->next)) <= 0)
|
||||||
|
{ /* amount of data remained to be read */
|
||||||
|
if((w = n > MAX_SSIZE ? MAX_SSIZE : (ssize_t)n) < 0)
|
||||||
|
{ if(fr->extent < 0)
|
||||||
|
--- src/lib/libast/sfio/sfpoll.c
|
||||||
|
+++ src/lib/libast/sfio/sfpoll.c 2013-10-18 11:59:50.778735232 +0000
|
||||||
|
@@ -138,7 +138,7 @@ int tm; /* time in millisecs for select
|
||||||
|
while((np = SFPOLL(fds,m,tm)) < 0 )
|
||||||
|
{ if(errno == eintr || errno == EAGAIN)
|
||||||
|
errno = 0;
|
||||||
|
- else break;
|
||||||
|
+ else goto report;
|
||||||
|
}
|
||||||
|
if(np > 0) /* poll succeeded */
|
||||||
|
np = c;
|
||||||
|
@@ -147,14 +147,14 @@ int tm; /* time in millisecs for select
|
||||||
|
{ f = fa[check[r]];
|
||||||
|
|
||||||
|
if((f->flags&SF_WRITE) && !WRREADY(f) )
|
||||||
|
- { if(fds[m].revents&POLLOUT)
|
||||||
|
+ { if(fds[m].revents&(POLLOUT|POLLHUP|POLLERR))
|
||||||
|
status[check[r]] |= SF_WRITE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((f->flags&SF_READ) && !RDREADY(f))
|
||||||
|
{ if((f->mode&SF_WRITE) && HASAUXFD(f))
|
||||||
|
m += 1;
|
||||||
|
- if(fds[m].revents&POLLIN)
|
||||||
|
+ if(fds[m].revents&(POLLIN|POLLHUP|POLLERR))
|
||||||
|
status[check[r]] |= SF_READ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -200,7 +200,7 @@ int tm; /* time in millisecs for select
|
||||||
|
while((np = select(m+1,&rd,&wr,NIL(fd_set*),tmp)) < 0 )
|
||||||
|
{ if(errno == eintr)
|
||||||
|
errno = 0;
|
||||||
|
- else break;
|
||||||
|
+ else goto report;
|
||||||
|
}
|
||||||
|
if(np > 0)
|
||||||
|
np = c;
|
||||||
|
@@ -227,6 +227,7 @@ int tm; /* time in millisecs for select
|
||||||
|
}
|
||||||
|
#endif /*_lib_select*/
|
||||||
|
|
||||||
|
+ report:
|
||||||
|
for(r = c = 0; c < n; ++c)
|
||||||
|
{ if(status[c] == 0)
|
||||||
|
continue;
|
||||||
|
--- src/lib/libast/sfio/sfpool.c
|
||||||
|
+++ src/lib/libast/sfio/sfpool.c 2013-10-18 11:49:25.614237061 +0000
|
||||||
|
@@ -138,7 +138,7 @@ int n; /* current position in pool */
|
||||||
|
else /* write failed, recover buffer then quit */
|
||||||
|
{ if(w > 0)
|
||||||
|
{ v -= w;
|
||||||
|
- memcpy(head->data,(head->data+w),v);
|
||||||
|
+ memmove(head->data,(head->data+w),v);
|
||||||
|
}
|
||||||
|
head->next = head->data+v;
|
||||||
|
goto done;
|
||||||
|
@@ -147,7 +147,7 @@ int n; /* current position in pool */
|
||||||
|
|
||||||
|
/* move data from head to f */
|
||||||
|
if((head->data+k) != f->data )
|
||||||
|
- memcpy(f->data,(head->data+k),v);
|
||||||
|
+ memmove(f->data,(head->data+k),v);
|
||||||
|
f->next = f->data+v;
|
||||||
|
}
|
||||||
|
|
||||||
|
--- src/lib/libast/sfio/sfsetbuf.c
|
||||||
|
+++ src/lib/libast/sfio/sfsetbuf.c 2013-10-18 12:02:37.534736056 +0000
|
||||||
|
@@ -254,6 +254,15 @@ size_t size; /* buffer size, -1 for defa
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* set page size, this is also the desired default buffer size */
|
||||||
|
+ if(_Sfpage <= 0)
|
||||||
|
+ {
|
||||||
|
+#if _lib_getpagesize
|
||||||
|
+ if((_Sfpage = (size_t)getpagesize()) <= 0)
|
||||||
|
+#endif
|
||||||
|
+ _Sfpage = SF_PAGE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
#if SFSETLINEMODE
|
||||||
|
if(init)
|
||||||
|
f->flags |= sfsetlinemode();
|
||||||
|
@@ -308,15 +317,6 @@ size_t size; /* buffer size, -1 for defa
|
||||||
|
(void)_sfpopen(f,-1,-1,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- /* set page size, this is also the desired default buffer size */
|
||||||
|
- if(_Sfpage <= 0)
|
||||||
|
- {
|
||||||
|
-#if _lib_getpagesize
|
||||||
|
- if((_Sfpage = (size_t)getpagesize()) <= 0)
|
||||||
|
-#endif
|
||||||
|
- _Sfpage = SF_PAGE;
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MAP_TYPE
|
||||||
|
--- src/lib/libast/string/stropt.c
|
||||||
|
+++ src/lib/libast/string/stropt.c 2013-01-03 17:20:37.000000000 +0100
|
||||||
|
@@ -90,7 +90,7 @@ stropt(const char* as, const void* tab,
|
||||||
|
{
|
||||||
|
for (p = (char**)tab; t = *p; p = (char**)((char*)p + siz))
|
||||||
|
{
|
||||||
|
- for (v = s; *t && *t++ == *v; v++);
|
||||||
|
+ for (v = s; *t && *t == *v; t++, v++);
|
||||||
|
if (!*t || isspace(*v) || *v == ',' || *v == '=')
|
||||||
|
break;
|
||||||
|
if (*v == ':' && *(v + 1) == '=')
|
||||||
|
--- src/lib/libast/vmalloc/vmopen.c
|
||||||
|
+++ src/lib/libast/vmalloc/vmopen.c 2013-10-18 13:54:50.918235639 +0000
|
||||||
|
@@ -68,19 +68,22 @@ int mode; /* type of region */
|
||||||
|
Block_t *bp, *np;
|
||||||
|
Seg_t *seg;
|
||||||
|
Vmuchar_t *addr;
|
||||||
|
- int rv;
|
||||||
|
+ int rv, mt;
|
||||||
|
|
||||||
|
if(!meth || !disc || !disc->memoryf )
|
||||||
|
return NIL(Vmalloc_t*);
|
||||||
|
|
||||||
|
GETPAGESIZE(_Vmpagesize);
|
||||||
|
|
||||||
|
+ mode = (mode&VM_FLAGS) | meth->meth; /* start with user-settable flags */
|
||||||
|
+
|
||||||
|
vmp = &vmproto; /* avoid memory allocation here! */
|
||||||
|
memset(vmp, 0, sizeof(Vmalloc_t));
|
||||||
|
memcpy(&vmp->meth, meth, sizeof(Vmethod_t));
|
||||||
|
+ mt = vmp->meth.meth;
|
||||||
|
+ vmp->meth.meth = 0;
|
||||||
|
vmp->disc = disc;
|
||||||
|
|
||||||
|
- mode &= VM_FLAGS; /* start with user-settable flags */
|
||||||
|
size = 0;
|
||||||
|
|
||||||
|
if(disc->exceptf)
|
||||||
|
@@ -155,6 +158,8 @@ int mode; /* type of region */
|
||||||
|
seg->free = bp;
|
||||||
|
else vd->wild = bp;
|
||||||
|
|
||||||
|
+ vmp->meth.meth = mt;
|
||||||
|
+
|
||||||
|
done: /* now make the region handle */
|
||||||
|
if(vd->mode&VM_MEMORYF)
|
||||||
|
vm = &init->vm.vm;
|
361
ksh93-uninitialized.dif
Normal file
361
ksh93-uninitialized.dif
Normal file
@ -0,0 +1,361 @@
|
|||||||
|
--- src/cmd/builtin/pty.c
|
||||||
|
+++ src/cmd/builtin/pty.c 2013-10-25 13:30:22.019295258 +0000
|
||||||
|
@@ -503,7 +503,7 @@ masterline(Sfio_t* mp, Sfio_t* lp, char*
|
||||||
|
char* t;
|
||||||
|
ssize_t n;
|
||||||
|
ssize_t a;
|
||||||
|
- size_t promptlen;
|
||||||
|
+ size_t promptlen = 0;
|
||||||
|
ptrdiff_t d;
|
||||||
|
char promptbuf[64];
|
||||||
|
|
||||||
|
@@ -773,6 +773,8 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int del
|
||||||
|
!(master->buf = vmnewof(vm, 0, char, 2 * SF_BUFSIZE, 0)))
|
||||||
|
{
|
||||||
|
error(ERROR_SYSTEM|2, "out of space");
|
||||||
|
+ id = 0;
|
||||||
|
+ line = 0;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
master->vm = vm;
|
||||||
|
--- src/cmd/ksh93/edit/edit.c
|
||||||
|
+++ src/cmd/ksh93/edit/edit.c 2013-10-25 13:30:22.020295166 +0000
|
||||||
|
@@ -1414,12 +1414,12 @@ int ed_internal(const char *src, genchar
|
||||||
|
int ed_external(const genchar *src, char *dest)
|
||||||
|
{
|
||||||
|
register genchar wc;
|
||||||
|
- register int c,size;
|
||||||
|
register char *dp = dest;
|
||||||
|
char *dpmax = dp+sizeof(genchar)*MAXLINE-2;
|
||||||
|
if((char*)src == dp)
|
||||||
|
{
|
||||||
|
- char buffer[MAXLINE*sizeof(genchar)];
|
||||||
|
+ int c;
|
||||||
|
+ char buffer[MAXLINE*sizeof(genchar)] = "";
|
||||||
|
c = ed_external(src,buffer);
|
||||||
|
|
||||||
|
#ifdef _lib_wcscpy
|
||||||
|
@@ -1431,6 +1431,7 @@ int ed_external(const genchar *src, char
|
||||||
|
}
|
||||||
|
while((wc = *src++) && dp<dpmax)
|
||||||
|
{
|
||||||
|
+ ssize_t size;
|
||||||
|
if((size = mbconv(dp, wc)) < 0)
|
||||||
|
{
|
||||||
|
/* copy the character as is */
|
||||||
|
--- src/cmd/ksh93/sh/init.c
|
||||||
|
+++ src/cmd/ksh93/sh/init.c 2013-10-25 13:30:22.020295166 +0000
|
||||||
|
@@ -1264,7 +1264,7 @@ Shell_t *sh_init(register int argc,regis
|
||||||
|
static int beenhere;
|
||||||
|
Shell_t *shp;
|
||||||
|
register int n;
|
||||||
|
- int type;
|
||||||
|
+ int type = 0;
|
||||||
|
static char *login_files[3];
|
||||||
|
memfatal();
|
||||||
|
n = strlen(e_version);
|
||||||
|
@@ -1943,7 +1943,7 @@ static Dt_t *inittree(Shell_t *shp,const
|
||||||
|
register const struct shtable2 *tp;
|
||||||
|
register unsigned n = 0;
|
||||||
|
register Dt_t *treep;
|
||||||
|
- Dt_t *base_treep, *dict;
|
||||||
|
+ Dt_t *base_treep, *dict = 0;
|
||||||
|
for(tp=name_vals;*tp->sh_name;tp++)
|
||||||
|
n++;
|
||||||
|
np = (Namval_t*)calloc(n,sizeof(Namval_t));
|
||||||
|
--- src/cmd/ksh93/sh/macro.c
|
||||||
|
+++ src/cmd/ksh93/sh/macro.c 2013-10-25 13:30:22.021295073 +0000
|
||||||
|
@@ -1794,7 +1794,7 @@ retry2:
|
||||||
|
register int d = (mode=='@'?' ':mp->ifs);
|
||||||
|
regoff_t match[2*(MATCH_MAX+1)];
|
||||||
|
int nmatch, nmatch_prev, vsize_last;
|
||||||
|
- char *vlast;
|
||||||
|
+ char *vlast=NULL;
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
if(!v)
|
||||||
|
--- src/cmd/ksh93/sh/name.c
|
||||||
|
+++ src/cmd/ksh93/sh/name.c 2013-10-25 13:30:22.022294981 +0000
|
||||||
|
@@ -1344,7 +1344,7 @@ Namval_t *nv_open(const char *name, Dt_t
|
||||||
|
const char *msg = e_varname;
|
||||||
|
char *fname = 0;
|
||||||
|
int offset = staktell();
|
||||||
|
- Dt_t *funroot;
|
||||||
|
+ Dt_t *funroot = NIL(Dt_t*);
|
||||||
|
#if NVCACHE
|
||||||
|
struct Cache_entry *xp;
|
||||||
|
#endif
|
||||||
|
@@ -1820,7 +1820,7 @@ void nv_putval(register Namval_t *np, co
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const char *tofree=0;
|
||||||
|
- int offset,append;
|
||||||
|
+ int offset=0,append;
|
||||||
|
#if _lib_pathnative
|
||||||
|
char buff[PATH_MAX];
|
||||||
|
#endif /* _lib_pathnative */
|
||||||
|
--- src/cmd/ksh93/sh/nvdisc.c
|
||||||
|
+++ src/cmd/ksh93/sh/nvdisc.c 2013-10-25 13:30:22.022294981 +0000
|
||||||
|
@@ -449,7 +449,7 @@ static Sfdouble_t lookupn(Namval_t *np,
|
||||||
|
char *nv_setdisc(register Namval_t* np,register const char *event,Namval_t *action,register Namfun_t *fp)
|
||||||
|
{
|
||||||
|
register struct vardisc *vp = (struct vardisc*)np->nvfun;
|
||||||
|
- register int type;
|
||||||
|
+ register int type = -1;
|
||||||
|
char *empty = "";
|
||||||
|
while(vp)
|
||||||
|
{
|
||||||
|
@@ -505,6 +505,8 @@ char *nv_setdisc(register Namval_t* np,r
|
||||||
|
}
|
||||||
|
return(NIL(char*));
|
||||||
|
}
|
||||||
|
+ if (type < 0)
|
||||||
|
+ return(NIL(char*));
|
||||||
|
/* Handle GET/SET/APPEND/UNSET disc */
|
||||||
|
if(vp && vp->fun.disc->putval!=assign)
|
||||||
|
vp = 0;
|
||||||
|
--- src/cmd/ksh93/sh/nvtree.c
|
||||||
|
+++ src/cmd/ksh93/sh/nvtree.c 2013-10-25 13:30:22.023294889 +0000
|
||||||
|
@@ -583,7 +583,7 @@ void nv_outnode(Namval_t *np, Sfio_t* ou
|
||||||
|
char *fmtq,*ep,*xp;
|
||||||
|
Namval_t *mp;
|
||||||
|
Namarr_t *ap = nv_arrayptr(np);
|
||||||
|
- int scan,tabs=0,c,more,associative = 0;
|
||||||
|
+ int scan=0,tabs=0,c,more,associative = 0;
|
||||||
|
int saveI = Indent;
|
||||||
|
Indent = indent;
|
||||||
|
if(ap)
|
||||||
|
@@ -696,7 +696,7 @@ void nv_outnode(Namval_t *np, Sfio_t* ou
|
||||||
|
|
||||||
|
static void outval(char *name, const char *vname, struct Walk *wp)
|
||||||
|
{
|
||||||
|
- register Namval_t *np, *nq, *last_table=wp->shp->last_table;
|
||||||
|
+ register Namval_t *np, *nq=0, *last_table=wp->shp->last_table;
|
||||||
|
register Namfun_t *fp;
|
||||||
|
int isarray=0, special=0,mode=0;
|
||||||
|
if(*name!='.' || vname[strlen(vname)-1]==']')
|
||||||
|
--- src/cmd/ksh93/sh/nvtype.c
|
||||||
|
+++ src/cmd/ksh93/sh/nvtype.c 2013-10-25 13:30:22.023294889 +0000
|
||||||
|
@@ -854,9 +854,10 @@ void nv_newtype(Namval_t *mp)
|
||||||
|
Namval_t *nv_mktype(Namval_t **nodes, int numnodes)
|
||||||
|
{
|
||||||
|
Namval_t *mp=nodes[0], *bp=0, *np, *nq, **mnodes=nodes;
|
||||||
|
- int i,j,k,m,n,nd=0,nref=0,iref=0,inherit=0;
|
||||||
|
+ int i,j,k,nd=0,nref=0,iref=0,inherit=0;
|
||||||
|
int size=sizeof(NV_DATA), dsize=0, nnodes;
|
||||||
|
- size_t offset=0;
|
||||||
|
+ size_t offset=0,m;
|
||||||
|
+ ssize_t n;
|
||||||
|
char *name=0, *cp, *sp, **help;
|
||||||
|
Namtype_t *pp,*qp=0,*dp,*tp;
|
||||||
|
Dt_t *root = nv_dict(mp);
|
||||||
|
@@ -869,6 +870,7 @@ Namval_t *nv_mktype(Namval_t **nodes, in
|
||||||
|
_nv_unset(nodes[0],NV_RDONLY);
|
||||||
|
errormsg(SH_DICT,ERROR_exit(1),e_badtypedef,cp);
|
||||||
|
}
|
||||||
|
+ n=strlen(nodes[1]->nvname);
|
||||||
|
for(nnodes=1,i=1; i <numnodes; i++)
|
||||||
|
{
|
||||||
|
np=nodes[i];
|
||||||
|
@@ -1100,7 +1102,6 @@ Namval_t *nv_mktype(Namval_t **nodes, in
|
||||||
|
nv_disc(nq, &pp->childfun.fun, NV_LAST);
|
||||||
|
if(tp = (Namtype_t*)nv_hasdisc(nq, &type_disc))
|
||||||
|
tp->strsize = -tp->strsize;
|
||||||
|
-else sfprintf(sfstderr,"tp==NULL\n");
|
||||||
|
for(r=0; r < dp->numnodes; r++)
|
||||||
|
{
|
||||||
|
Namval_t *nr = nv_namptr(dp->nodes,r);
|
||||||
|
--- src/cmd/ksh93/sh/parse.c
|
||||||
|
+++ src/cmd/ksh93/sh/parse.c 2013-10-25 13:30:22.024294796 +0000
|
||||||
|
@@ -301,7 +301,7 @@ static Shnode_t *getanode(Lex_t *lp, str
|
||||||
|
*/
|
||||||
|
static Shnode_t *makelist(Lex_t *lexp, int type, Shnode_t *l, Shnode_t *r)
|
||||||
|
{
|
||||||
|
- register Shnode_t *t;
|
||||||
|
+ register Shnode_t *t = NIL(Shnode_t*);
|
||||||
|
if(!l || !r)
|
||||||
|
sh_syntax(lexp);
|
||||||
|
else
|
||||||
|
@@ -742,7 +742,7 @@ static Shnode_t *funct(Lex_t *lexp)
|
||||||
|
register Shnode_t *t;
|
||||||
|
register int flag;
|
||||||
|
struct slnod *volatile slp=0;
|
||||||
|
- Stak_t *savstak;
|
||||||
|
+ Stak_t *savstak = NIL(Stak_t*);
|
||||||
|
Sfoff_t first, last;
|
||||||
|
struct functnod *volatile fp;
|
||||||
|
Sfio_t *iop;
|
||||||
|
@@ -815,7 +815,7 @@ static Shnode_t *funct(Lex_t *lexp)
|
||||||
|
{
|
||||||
|
struct comnod *ac;
|
||||||
|
char *cp, **argv, **argv0;
|
||||||
|
- int c;
|
||||||
|
+ int c=-1;
|
||||||
|
t->funct.functargs = ac = (struct comnod*)simple(lexp,SH_NOIO|SH_FUNDEF,NIL(struct ionod*));
|
||||||
|
if(ac->comset || (ac->comtyp&COMSCAN))
|
||||||
|
errormsg(SH_DICT,ERROR_exit(3),e_lexsyntax4,lexp->sh->inlineno);
|
||||||
|
--- src/cmd/ksh93/sh/xec.c
|
||||||
|
+++ src/cmd/ksh93/sh/xec.c 2013-10-25 13:30:22.025294704 +0000
|
||||||
|
@@ -1507,7 +1507,7 @@ int sh_exec(register const Shnode_t *t,
|
||||||
|
Namval_t node;
|
||||||
|
#endif /* SHOPT_NAMESPACE */
|
||||||
|
struct Namref nr;
|
||||||
|
- long mode;
|
||||||
|
+ long mode = 0;
|
||||||
|
register struct slnod *slp;
|
||||||
|
if(!np->nvalue.ip)
|
||||||
|
{
|
||||||
|
@@ -1916,8 +1916,8 @@ int sh_exec(register const Shnode_t *t,
|
||||||
|
* don't create a new process, just
|
||||||
|
* save and restore io-streams
|
||||||
|
*/
|
||||||
|
- pid_t pid;
|
||||||
|
- int jmpval, waitall;
|
||||||
|
+ pid_t pid = 0;
|
||||||
|
+ int jmpval, waitall = 0;
|
||||||
|
int simple = (t->fork.forktre->tre.tretyp&COMMSK)==TCOM;
|
||||||
|
struct checkpt *buffp = (struct checkpt*)stkalloc(shp->stk,sizeof(struct checkpt));
|
||||||
|
#if SHOPT_COSHELL
|
||||||
|
@@ -2409,7 +2409,7 @@ int sh_exec(register const Shnode_t *t,
|
||||||
|
Shnode_t *tt = t->wh.whtre;
|
||||||
|
#if SHOPT_FILESCAN
|
||||||
|
Sfio_t *iop=0;
|
||||||
|
- int savein;
|
||||||
|
+ int savein=-1;
|
||||||
|
#endif /*SHOPT_FILESCAN*/
|
||||||
|
#if SHOPT_OPTIMIZE
|
||||||
|
int jmpval = ((struct checkpt*)shp->jmplist)->mode;
|
||||||
|
@@ -2877,7 +2877,7 @@ int sh_exec(register const Shnode_t *t,
|
||||||
|
else
|
||||||
|
{
|
||||||
|
register int traceon=0;
|
||||||
|
- register char *right;
|
||||||
|
+ register char *right = 0;
|
||||||
|
register char *trap;
|
||||||
|
char *argv[6];
|
||||||
|
n = type>>TSHIFT;
|
||||||
|
@@ -2911,7 +2911,7 @@ int sh_exec(register const Shnode_t *t,
|
||||||
|
}
|
||||||
|
else if(type&TBINARY)
|
||||||
|
{
|
||||||
|
- char *op;
|
||||||
|
+ char *op = 0;
|
||||||
|
int pattern = 0;
|
||||||
|
if(trap || traceon)
|
||||||
|
op = (char*)(shtab_testops+(n&037)-1)->sh_name;
|
||||||
|
@@ -3376,7 +3376,7 @@ int sh_funscope(int argn, char *argv[],i
|
||||||
|
int jmpval;
|
||||||
|
volatile int r = 0;
|
||||||
|
int n;
|
||||||
|
- char *savstak;
|
||||||
|
+ char *savstak = 0;
|
||||||
|
struct funenv *fp = 0;
|
||||||
|
struct checkpt *buffp = (struct checkpt*)stkalloc(shp->stk,sizeof(struct checkpt));
|
||||||
|
Namval_t *nspace = shp->namespace;
|
||||||
|
@@ -3492,10 +3492,10 @@ int sh_funscope(int argn, char *argv[],i
|
||||||
|
shp->st = *prevscope;
|
||||||
|
shp->topscope = (Shscope_t*)prevscope;
|
||||||
|
nv_getval(sh_scoped(shp,IFSNOD));
|
||||||
|
- if(nsig)
|
||||||
|
+ if(nsig && savstak)
|
||||||
|
memcpy((char*)&shp->st.trapcom[0],savstak,nsig);
|
||||||
|
shp->trapnote=0;
|
||||||
|
- if(nsig)
|
||||||
|
+ if(nsig && savstak)
|
||||||
|
stakset(savstak,0);
|
||||||
|
shp->options = options;
|
||||||
|
shp->last_root = last_root;
|
||||||
|
@@ -3584,11 +3584,11 @@ static void sh_funct(Shell_t *shp,Namval
|
||||||
|
int sh_fun(Namval_t *np, Namval_t *nq, char *argv[])
|
||||||
|
{
|
||||||
|
Shell_t *shp = sh_getinterp();
|
||||||
|
- register int offset;
|
||||||
|
+ register int offset = 0;
|
||||||
|
register char *base;
|
||||||
|
Namval_t node;
|
||||||
|
struct Namref nr;
|
||||||
|
- long mode;
|
||||||
|
+ long mode = 0;
|
||||||
|
char *prefix = shp->prefix;
|
||||||
|
int n=0;
|
||||||
|
char *av[3];
|
||||||
|
--- src/lib/libast/sfio/sfstrtof.h
|
||||||
|
+++ src/lib/libast/sfio/sfstrtof.h 2013-10-25 13:30:22.025294704 +0000
|
||||||
|
@@ -211,8 +211,8 @@ S2F_function(str, end) char* str; char**
|
||||||
|
int decimal = 0;
|
||||||
|
int thousand = 0;
|
||||||
|
int part = 0;
|
||||||
|
- int back_part;
|
||||||
|
- S2F_batch back_n;
|
||||||
|
+ int back_part = 0;
|
||||||
|
+ S2F_batch back_n = 0;
|
||||||
|
S2F_number v;
|
||||||
|
S2F_number p;
|
||||||
|
S2F_part_t parts[16];
|
||||||
|
--- src/lib/libast/sfio/sftable.c
|
||||||
|
+++ src/lib/libast/sfio/sftable.c 2013-10-25 13:30:22.026294612 +0000
|
||||||
|
@@ -53,7 +53,7 @@ int type; /* >0: scanf, =0: printf, -1:
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int base, fmt, flags, dot, width, precis;
|
||||||
|
- ssize_t n_str, size;
|
||||||
|
+ ssize_t n_str, size = 0;
|
||||||
|
char *t_str, *sp;
|
||||||
|
int v, n, skip, dollar, decimal, thousand;
|
||||||
|
Sffmt_t savft;
|
||||||
|
--- src/lib/libast/sfio/sfvprintf.c
|
||||||
|
+++ src/lib/libast/sfio/sfvprintf.c 2013-10-25 13:30:22.026294612 +0000
|
||||||
|
@@ -101,7 +101,7 @@ char* form; /* format to use */
|
||||||
|
va_list args; /* arg list if !argf */
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
- int n, v, w, k, n_s, base, fmt, flags;
|
||||||
|
+ int n, v=0, w, k, n_s, base, fmt, flags;
|
||||||
|
Sflong_t lv;
|
||||||
|
char *sp, *ssp, *endsp, *ep, *endep;
|
||||||
|
int dot, width, precis, sign, decpt;
|
||||||
|
@@ -129,7 +129,7 @@ va_list args; /* arg list if !argf */
|
||||||
|
int decimal = 0, thousand = 0;
|
||||||
|
|
||||||
|
#if _has_multibyte
|
||||||
|
- wchar_t* wsp;
|
||||||
|
+ wchar_t* wsp = 0;
|
||||||
|
SFMBDCL(fmbs) /* state of format string */
|
||||||
|
SFMBDCL(mbs) /* state of some string */
|
||||||
|
#ifdef mbwidth
|
||||||
|
--- src/lib/libast/string/stropt.c
|
||||||
|
+++ src/lib/libast/string/stropt.c 2013-10-25 13:30:22.033293966 +0000
|
||||||
|
@@ -60,13 +60,13 @@ stropt(const char* as, const void* tab,
|
||||||
|
register char* v;
|
||||||
|
register char* t;
|
||||||
|
char** p;
|
||||||
|
- char* u;
|
||||||
|
+ char* u = 0;
|
||||||
|
char* x;
|
||||||
|
char* e;
|
||||||
|
int n;
|
||||||
|
int ql;
|
||||||
|
int qr;
|
||||||
|
- int qc;
|
||||||
|
+ int qc = 0;
|
||||||
|
|
||||||
|
if (!as) n = 0;
|
||||||
|
else if (!(x = s = strdup(as))) n = -1;
|
||||||
|
--- src/lib/libast/string/strtoi.h
|
||||||
|
+++ src/lib/libast/string/strtoi.h 2013-10-25 13:30:22.027294520 +0000
|
||||||
|
@@ -230,13 +230,13 @@ S2I_function(a, e, base) const char* a;
|
||||||
|
#endif
|
||||||
|
register S2I_unumber n;
|
||||||
|
register S2I_unumber x;
|
||||||
|
- register int c;
|
||||||
|
+ register int c = 0;
|
||||||
|
register int shift;
|
||||||
|
register unsigned char* p;
|
||||||
|
register unsigned char* cv;
|
||||||
|
unsigned char* b;
|
||||||
|
unsigned char* k;
|
||||||
|
- S2I_unumber v;
|
||||||
|
+ S2I_unumber v = 0;
|
||||||
|
#if S2I_multiplier
|
||||||
|
register int base;
|
||||||
|
#endif
|
14
sigexec.c
14
sigexec.c
@ -56,8 +56,16 @@ int main(int argc, char* argv[])
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
}
|
}
|
||||||
if (tcgetattr(0, &o) < 0) {
|
if (tcgetattr(0, &o) < 0) {
|
||||||
|
#ifdef B115200
|
||||||
|
cfsetispeed(&o, B115200);
|
||||||
|
cfsetospeed(&o, B115200);
|
||||||
|
#elif defined(B57600)
|
||||||
|
cfsetispeed(&o, B57600);
|
||||||
|
cfsetospeed(&o, B57600);
|
||||||
|
#elif defined(B38400)
|
||||||
cfsetispeed(&o, B38400);
|
cfsetispeed(&o, B38400);
|
||||||
cfsetospeed(&o, B38400);
|
cfsetospeed(&o, B38400);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
o.c_iflag = TTYDEF_IFLAG;
|
o.c_iflag = TTYDEF_IFLAG;
|
||||||
@ -66,7 +74,13 @@ int main(int argc, char* argv[])
|
|||||||
# ifdef CBAUD
|
# ifdef CBAUD
|
||||||
o.c_lflag &= ~CBAUD;
|
o.c_lflag &= ~CBAUD;
|
||||||
# endif
|
# endif
|
||||||
|
#ifdef B115200
|
||||||
|
o.c_cflag = B115200;
|
||||||
|
#elif defined(B57600)
|
||||||
|
o.c_cflag = B57600;
|
||||||
|
#elif defined(B38400)
|
||||||
o.c_cflag = B38400;
|
o.c_cflag = B38400;
|
||||||
|
#endif
|
||||||
o.c_cflag |= TTYDEF_CFLAG;
|
o.c_cflag |= TTYDEF_CFLAG;
|
||||||
|
|
||||||
/* Sane setting, allow eight bit characters, no carriage return delay
|
/* Sane setting, allow eight bit characters, no carriage return delay
|
||||||
|
Loading…
x
Reference in New Issue
Block a user