Commit Graph

114 Commits

Author SHA1 Message Date
Eivind Eklund 007d33500e Remove simultaneous include of <sys/param.h> and <sys/types.h>.
Reorder includes to be alphabetical some places since I already was in
here.
1997-12-10 22:18:54 +00:00
John Polstra c351e0897e Document the exit status for a command that was terminated by a
signal.
1997-11-12 04:32:50 +00:00
Bruce Evans 28701136f7 Fixed some type and value mismatches. setsignal() returned a bogusly
cast value that was always ignored.  Rev.1.9 of trap.c made this
more bogus by returning a semantically different value after calling
siginterrupt().  Avoid these problems by not returning a value.
1997-11-10 11:32:24 +00:00
Andrey A. Chernov 8dd81503df 1) Fix longstanding bug:
trap 'echo xxx' 1 2 3 15
	read x
is not interrupted by ^C (due to restartable read syscall) and must be
interrupted per POSIX
Worse case:
	read -t 5 x
hangs forever after ^C pressed (supposed to timeout after 5 secs)
Fixed by adding siginterrupt(signo, 1) after catch handler installed

2) Do not reinstall sighandler immediately after it is called,
BSD do it for us
1997-11-05 23:33:58 +00:00
Jordan K. Hubbard 97fe7f477f Changes to support full make parallelism (-j<n>) in the world
target.
Reviewed by:	<many different folks>
Submitted by:	Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>
1997-10-05 09:40:24 +00:00
Mike Smith afa53c8df7 Add the '-t timeout' option to the 'read' builtin. This allows the
'read' command to return an error if the user fails to supply any
input withink a given time period.  The behaviour of this option is
similar to that of the like-named option in ksh93.

Reviewed by:	joerg
1997-09-29 15:15:16 +00:00
Wolfram Schneider c7a197e1d8 PR: docs/4449
The -c flag is not documented in the sh(1) manapge.

Submitted by: adrian@virginia.edu
1997-09-13 17:40:00 +00:00
Bruce Evans 18f368f2e4 Restored clobbered parts of rev.1.15 (build intermediate object files
for tools).
1997-08-25 19:50:01 +00:00
Steve Price ead152eb86 Make all status values an integral type and use
pid_t when referring to process IDs.
1997-08-18 02:53:20 +00:00
Jordan K. Hubbard f2d0ae8518 Back out previous fix - this bug's got diplomatic immunity as a registered
political issue.
1997-06-19 17:57:06 +00:00
Jordan K. Hubbard fc0eef9f89 >Number: 3780
>Category:       bin
>Synopsis:       WEXITSTATUS() may return nagative value, which causes sh to generate bad $?

PR:		3780
Submitted by:	sanewo@ba2.so-net.or.jp
1997-06-19 15:14:01 +00:00
Andrey A. Chernov ea1376dfbb Now [^abc] means the same as [!abc] like bash and *csh already does 1997-06-06 23:04:33 +00:00
Steve Price 00fc54b03c Make sh(1) less aware of the bit fields returned by wait by
using the WIF* macros in sys/wait.h.

PR: bin/3668
Submitted by:	dholland@eecs.harvard.edu
1997-05-24 21:04:55 +00:00
Steve Price 9e5a9c06d0 Remove y.tab.h from the beforedepend target. Also add a
rule that shows the dependency of arith_lex.[co] on y.tab.h.

Suggested by: Bruce Evans <bde@zeta.org.au>
1997-05-21 03:23:23 +00:00
Steve Price b7059dd6df Add explicit y.tab.h rule so that 'make depend clean all' does
not fail with an "don't know how to make y.tab.h" error.
1997-05-19 00:29:29 +00:00
Steve Price e7a0b0244d Use the __unused attribute where warranted. 1997-05-19 00:18:52 +00:00
Steve Price f7a827cc92 Miscellaneous sorting and addition of rules for object files that
depend on generated headers.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
1997-05-19 00:16:27 +00:00
Steve Price ea76be72fe Revise the section that explains how to protect parts of an $ENV script
from being executed in non-interactive mode.

Suggested and Reviewed by: Brian Somers <brian@freebsd.org>
1997-05-07 11:42:00 +00:00
Steve Price 2afa86e799 Don't source $ENV unless this is an interactive shell. 1997-05-05 03:45:17 +00:00
Steve Price 5382d20cf1 Turn on the new type builtin. 1997-04-28 03:50:07 +00:00
Steve Price 96522b887c Sync with NetBSD's revision 1.29 of this file.
Obtained from: NetBSD
1997-04-28 03:28:43 +00:00
Steve Price f4eb55ba86 Remove an extra semicolon and nuke register keyword usage. 1997-04-28 03:27:12 +00:00
Steve Price 79f569479b Fix redirection of unopened file descriptors and nuke register
keyword usage.

Obtained from: NetBSD
1997-04-28 03:25:13 +00:00
Steve Price 7920a31db6 Revert changes from rev 1.16 to 1.17 for now. Closes PR 2879. 1997-04-28 03:22:09 +00:00
Steve Price ab72124fb4 mdoc-ify and cleanup UNIMPLEMENTED messages. Closes PR 2880. 1997-04-28 03:20:09 +00:00
Steve Price 115359949d Reorder declarations slightly. 1997-04-28 03:17:51 +00:00
Steve Price 904a3dc819 Avoid a possible NULL pointer dereference, nuke register usage,
and remove an unnecessary reset.

Obtained from: NetBSD
1997-04-28 03:16:12 +00:00
Steve Price 7e461ef4f3 Nuke register keyword usage, #if -> #ifdef, and avoid void *
arithmetic.

Obtained from: NetBSD
1997-04-28 03:14:04 +00:00
Steve Price 4ca7fe3b96 Nuke register keyword usage, rename pread to preadfd, and open
input files FD_CLOEXEC.

Obtained from: NetBSD
1997-04-28 03:11:52 +00:00
Steve Price 62730a71b9 When NO_HISTORY is defined and the history command is used
show an error message.

Inspired by: NetBSD
1997-04-28 03:10:31 +00:00
Steve Price 76ad65f7f6 Add a type builtin and nuke register keyword usage.
Obtained from: NetBSD
1997-04-28 03:08:38 +00:00
Steve Price afb033d5c4 Nuke register keyword usage and #if -> #ifdef.
Obtained from: NetBSD
1997-04-28 03:06:52 +00:00
Steve Price 61f4ddf420 Shamelessly pilfer most of NetBSD's Makefile so that the
problem with 'make -j n' and no .depend file goes away.
I think Bruce mentioned this somewhere on one of the
mailing lists.

Obtained from: NetBSD
1997-04-28 03:03:23 +00:00
Warner Losh 93ef08af3e compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-28 15:24:41 +00:00
Peter Wemm b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Steve Price 2293cbb28a Fix a expansion bug that caused the result of `echo $((1 << 30))`
to get truncated.

Submitted by: bde
1997-02-16 01:54:19 +00:00
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Steve Price 938ddab485 Fix a problem that caused some foreground pipelines to die with:
tcsetpgrp failed, errno=1

Discovered and Reviewed by: joerg
1997-01-06 01:26:44 +00:00
Steve Price 5e46e01939 Make sh(1) think and be in the same place at the same time. This closes
PR#2331: strange output of sh's pwd on symlinked directories.
1997-01-04 19:14:29 +00:00
Steve Price f98e1b8071 With these changes sh(1)'s trap command should be POSIX-compliant,
while remaining (becoming :) compatible with other popular shells.
Specifically these changes include:

1) Implement 'trap -l' to get a list of valid signals names.  This
   is useful if you wanted to do something like reset all signal
   handlers to there defaults values, in which case something like
   this will do the trick.

	trap `trap -l`

2) Reformat the output of 'trap' so it can be saved and later eval'd
   to restore the saved settings.

3) Allow the use of signal names as well as signal numbers.

4) Fix trap handling of SIGCHLD so that commands like the following
   (albeit, contrived) won't cause sh(1) to recurse ad infinitum.

	trap uname 0 20

5) Make variables static that are used only in trap.c.

6) Minor 'style(9) police' mods.
1996-12-24 23:59:53 +00:00
Steve Price 8df71a5a7d Oops, it needs little more caulk to get it right. 1996-12-23 22:29:03 +00:00
Steve Price 79e02527ef Apply a little dab of bit caulk to keep those beggars
from leaking out.

Noticed by: bde
1996-12-23 22:16:35 +00:00
Steve Price a41f1d080d Don't use _POSIX_PATH_MAX to limit the size of the path, instead
use 'getcwd(NULL, 0)' just as pwd(1) does.

Suggested by: bde
1996-12-23 05:31:48 +00:00
Steve Price 958ba632fa Make sh(1) a little braver in the face of adversity. sh(1)
now handles the getpwd() init problem the same way as bash
and ksh do.  Also while I was in here, I cleaned up the format
a little, removed some unnnecessary #if SYMLINKS cruft, and
changed the pwd builtin to use getcwd(3) as Joerg suggested.
1996-12-21 22:09:40 +00:00
Steve Price 33703c0825 This doesn't change any behavior, but may be a slight
optimization.  (num-- > 0) --> (--num >= 0).

Obtained from: NetBSD
1996-12-21 15:16:32 +00:00
Steve Price 5ac79b0aae Remove extra #undef. 1996-12-21 14:57:38 +00:00
Steve Price 93d0e5ef14 Fix a problem caused by finger failure on my part. The builtin
getopts should now work as expected.  This fix was in the NetBSD
code that I was merging from but missed getting into FreeBSD's
version because of 'drain bamage' on my part.

Submitted by:	NetBSD, joerg
1996-12-21 13:21:57 +00:00
Steve Price ab0a217285 Merge in NetBSD mods and -Wall cleaning.
Obtained from: NetBSD, me
1996-12-14 06:20:03 +00:00
Peter Wemm 7a2ce49ee0 Back out rev 1.7 which was to fix PR#1206 (to be reopened).
This patch causes too many side effects, one of which bites hard is
when interrupting a 'make fetch' in the ports tree (PR#1990).
This whole area is a real can of worms....

This most definately should go into 2.2

Reviewed by: steve, bde
1996-11-12 18:35:06 +00:00
Andrey A. Chernov 3cd859a7f1 1) define STATIC as static and not empty
2) replace collate_range_cmp call with its code
1996-10-31 07:15:57 +00:00