* move <sys/param.h> include to sh.h

* fix compilation and invocation of test suite with whitespace in
  the pathnames for real, this time
* clean up (especially whitespace)
This commit is contained in:
tg 2005-07-07 23:27:52 +00:00
parent 3506838417
commit ee7992988b
6 changed files with 40 additions and 44 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $MirOS: src/bin/mksh/Build.sh,v 1.15 2005/06/08 23:02:08 tg Exp $ # $MirOS: src/bin/mksh/Build.sh,v 1.16 2005/07/07 23:27:52 tg Exp $
#- #-
# Recognised environment variables and their defaults: # Recognised environment variables and their defaults:
# CC gcc # CC gcc
@ -7,9 +7,8 @@
# CPPFLAGS (empty) # CPPFLAGS (empty)
# LDFLAGS -static # LDFLAGS -static
# LIBS (empty) # LIBS (empty)
# srcdir (path of script)
# NROFF nroff # (ignored if -r option given) # NROFF nroff # (ignored if -r option given)
# GNU/Linux, Mac, Solaris: add -d, maybe -r, CPPFLAGS='-D_FILE_OFFSET_BITS=64' # GNU/Linux, Mac, Solaris: add -d, CPPFLAGS='-D_FILE_OFFSET_BITS=64'
SHELL="${SHELL:-/bin/sh}" SHELL="${SHELL:-/bin/sh}"
CC="${CC:-gcc}" CC="${CC:-gcc}"

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl #!/usr/bin/perl
# $MirOS: src/bin/mksh/check.pl,v 1.6 2005/06/08 21:39:59 tg Exp $ # $MirOS: src/bin/mksh/check.pl,v 1.7 2005/07/07 23:27:52 tg Exp $
# $OpenBSD: th,v 1.12 2005/05/28 04:53:47 millert Exp $ # $OpenBSD: th,v 1.12 2005/05/28 04:53:47 millert Exp $
#- #-
# Example test: # Example test:
@ -17,7 +17,7 @@
# + false # + false
# expected-exit: 1 # expected-exit: 1
# --- # ---
# This runs the test-program (eg, pdksh) with the arguments -x and -f, # This runs the test-program (eg, mksh) with the arguments -x and -f,
# standard input is a file containing "echo hi*\nfalse\n". The program # standard input is a file containing "echo hi*\nfalse\n". The program
# is expected to produce "hi*" (no trailing newline) on standard output, # is expected to produce "hi*" (no trailing newline) on standard output,
# "+ echo hi*\n+false\n" on standard error, and an exit code of 1. # "+ echo hi*\n+false\n" on standard error, and an exit code of 1.
@ -484,7 +484,6 @@ run_test
if ($program_kludge) { if ($program_kludge) {
@argv = split(' ', $test_prog); @argv = split(' ', $test_prog);
} else { } else {
$test_prog =~ s/ /\\ /g;
@argv = ($test_prog); @argv = ($test_prog);
} }
if (defined $test{'arguments'}) { if (defined $test{'arguments'}) {
@ -493,7 +492,7 @@ run_test
substr($test{'arguments'}, 1))); substr($test{'arguments'}, 1)));
} }
push(@argv, $temps) if defined $test{'script'}; push(@argv, $temps) if defined $test{'script'};
exec(@argv); exec { $argv[0] } @argv;
print STDERR "$prog: couldn't execute $test_prog - $!\n"; print STDERR "$prog: couldn't execute $test_prog - $!\n";
kill('TERM', $$); kill('TERM', $$);
exit(95); exit(95);

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.25 2005/07/07 22:00:45 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.26 2005/07/07 23:27:52 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -3066,7 +3066,7 @@ description:
Check that (here doc) temp files are not left behind after an exec. Check that (here doc) temp files are not left behind after an exec.
stdin: stdin:
mkdir foo || exit 1 mkdir foo || exit 1
TMPDIR=$PWD/foo $0 <<- 'EOF' TMPDIR=$PWD/foo "$0" <<- 'EOF'
x() { x() {
sed 's/^/X /' << E_O_F sed 's/^/X /' << E_O_F
hi hi
@ -3079,7 +3079,7 @@ stdin:
exec $echo subtest-1 hi exec $echo subtest-1 hi
EOF EOF
echo subtest-1 foo/* echo subtest-1 foo/*
TMPDIR=$PWD/foo $0 <<- 'EOF' TMPDIR=$PWD/foo "$0" <<- 'EOF'
echo=echo; [ -x /bin/echo ] && echo=/bin/echo echo=echo; [ -x /bin/echo ] && echo=/bin/echo
sed 's/^/X /' << E_O_F; exec $echo subtest-2 hi sed 's/^/X /' << E_O_F; exec $echo subtest-2 hi
a a

View File

@ -1,14 +1,13 @@
/** $MirOS: src/bin/mksh/histrap.c,v 1.9 2005/06/24 15:36:57 tg Exp $ */ /** $MirOS: src/bin/mksh/histrap.c,v 1.10 2005/07/07 23:27:52 tg Exp $ */
/* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h" #include "sh.h"
#include <sys/param.h> /* for BSD */
#include <sys/file.h> #include <sys/file.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/stat.h> #include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.9 2005/06/24 15:36:57 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.10 2005/07/07 23:27:52 tg Exp $");
static int histfd; static int histfd;
static int hsize; static int hsize;

5
misc.c
View File

@ -1,13 +1,12 @@
/** $MirOS: src/bin/mksh/misc.c,v 1.6 2005/07/04 12:34:23 tg Exp $ */ /** $MirOS: src/bin/mksh/misc.c,v 1.7 2005/07/07 23:27:52 tg Exp $ */
/* $OpenBSD: misc.c,v 1.28 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: misc.c,v 1.28 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: path.c,v 1.12 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: path.c,v 1.12 2005/03/30 17:16:37 deraadt Exp $ */
#include "sh.h" #include "sh.h"
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/param.h> /* for MAXPATHLEN */
#include <sys/stat.h> #include <sys/stat.h>
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.6 2005/07/04 12:34:23 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/misc.c,v 1.7 2005/07/07 23:27:52 tg Exp $");
short chtypes[UCHAR_MAX+1]; /* type bits for unsigned char */ short chtypes[UCHAR_MAX+1]; /* type bits for unsigned char */

4
sh.h
View File

@ -1,4 +1,4 @@
/** $MirOS: src/bin/mksh/sh.h,v 1.15 2005/07/05 22:00:20 tg Exp $ */ /** $MirOS: src/bin/mksh/sh.h,v 1.16 2005/07/07 23:27:52 tg Exp $ */
/* $OpenBSD: sh.h,v 1.27 2005/03/28 21:33:04 deraadt Exp $ */ /* $OpenBSD: sh.h,v 1.27 2005/03/28 21:33:04 deraadt Exp $ */
/* $OpenBSD: shf.h,v 1.5 2005/03/30 17:16:37 deraadt Exp $ */ /* $OpenBSD: shf.h,v 1.5 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: table.h,v 1.6 2004/12/18 20:55:52 millert Exp $ */ /* $OpenBSD: table.h,v 1.6 2004/12/18 20:55:52 millert Exp $ */
@ -13,7 +13,7 @@
#define _ALL_SOURCE #define _ALL_SOURCE
#endif #endif
#include <sys/types.h> #include <sys/param.h>
#if defined(__gnu_linux__) && !defined(_POSIX_SOURCE) #if defined(__gnu_linux__) && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE #define _POSIX_SOURCE