Commit Graph

629 Commits

Author SHA1 Message Date
bde
7245195d50 Don't use mmap() for non-regular files, since st_size is only meaningful
for regular files.  This fixes recent breakage of cp'ing from /dev/zero.
/dev/zero doesn't support mmap(), but the device driver mmap routines are
not called for mapping 0 bytes, so the error was not detected.  mmap()
can't even be used for cp'ing special files that support mmap(), since
there is general way to determine the file size.
1998-11-18 11:47:45 +00:00
wosch
4314ed9126 Use mmap for file coping. 5-10% faster than the read system call. 1998-11-14 23:43:11 +00:00
msmith
65733af597 Fix behaviour for 'mkdir -m 777 / /tmp/foo'. Play "guess the style bug"
with Bruce again.

Reported by:	bde
1998-10-23 06:28:40 +00:00
msmith
f6d3d7d6d5 Honour the spirit rather than the implementation of the previous changes;
if we are invoked with -m, use chmod() on the final directory component
in order to ensure the mode is correctly set.
1998-10-22 21:42:20 +00:00
msmith
ab2f649a67 Make this compile, and honour the spirit of the original design while
incorporating the intended fix.  Attempt to address some of the
putative style bugs introduced.  Others doubtless remain.

Embarrassed by: bde
1998-10-20 08:04:15 +00:00
msmith
1f0ecb9ee1 - mkdir -m should call chmod because the high-order bits get ignored
by the kernel as a security feature of some sort.

Submitted by:	Wilfredo Sanchez <wsanchez@apple.com>
1998-10-20 06:37:01 +00:00
msmith
6a60a09cd8 - Fix off-by-one problem in tar where filenames of length 100
and dirnames of length 99 don't archive.

Submitted by:	Wilfredo Sanchez <wsanchez@apple.com>
Obtained from:  OpenBSD
1998-10-20 05:52:33 +00:00
des
d55d163bcc Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR:		Loosely related to bin/8252
Approved by:	jkh and bde
1998-10-13 14:52:33 +00:00
des
b96c86d018 Doh. What was I smoking when I wrote this?
PR:		bin/8301
Submitted by:	Tetsuya Furukawa <tetsuya@secom-sis.co.jp>
1998-10-13 12:19:31 +00:00
jkoshy
a6550ca750 Correct a grammatical nit and remove ambiguity about the effect of
the -p option.

PR:		8229
Submitted-by:	Sheldon Hearn <axl@iafrica.com>
1998-10-13 08:52:29 +00:00
markm
f7173f04af Add JKH's auth.conf-file parser to turn Kerberos on/off in userland. 1998-10-09 06:31:45 +00:00
jkh
77144f0690 Null commit, just to test something. Please ignore. 1998-10-04 00:41:08 +00:00
alex
6cec1f9e81 Added missing #include <string.h> 1998-10-03 16:29:59 +00:00
ken
2a798f41e6 Fix 'chio params' so that it actually prints out the current picker.
(This was broken when the volume tag changes went in.)

Submitted by:	Josef Karthauser <joe@pavilion.net>
1998-10-01 23:30:14 +00:00
gibbs
0c7e0bbd0b Updated the ch(4) driver and chio(1) command to include volume
tag support.  These changes have been tested with a Breeze Hill
Q47 DLT and a DEC DLT2500 media changer.  The latter has no
volume tag support.

The chio(1) command was updated to include various flags to the
status subcommand.  These flags can be used to select additional
information to be displayed (like volume tags).

A new chio(1) subcommand named 'voltag' has been added which allows
for changes to volume tags inside the media changer controller.
This could not be tested as the Q47 does not provide the functio-
nality.

Submitted by:	Hans Huebner
1998-09-15 07:48:51 +00:00
dfr
ba505a4c7c Portability fixes when sizeof(int) != sizeof(long). 1998-09-14 08:32:20 +00:00
imp
78d1eb2897 Fix minor style bugs noticed by the Bruce Filter.[tm]
Bruce-Filter-By: bde
1998-09-13 19:54:54 +00:00
tegge
ea88244cf0 Be more consistent with handling of quote mark control character.
Don't output double-quotes inside variable expansion/arithmetic
expansion region in here-documents.  When leaving the arithmetic
expansion syntax mode, adjust the dblquote flag according to
previous syntax, in order to avoid splitting of quoted variables.
1998-09-13 19:24:57 +00:00
imp
1b26fba303 Silence -Wall -W -Wkitchen-sink. Use ssize_t in preference to int,
make a char * const that should have been.  Use new style function
declaration for main.  Mostly a Bruce Filter[tm] test commit.
1998-09-11 05:48:06 +00:00
cracauer
0a716cdf2c Narrow down conditions to break wait() to process traps.
Improve comments.
1998-09-10 22:09:11 +00:00
bde
4d0d1bdf0d Fixed breakage of %CPU and %MEM in the previous commit. sysctlbyname()
was called with wrong args so it always failed.

PR:		7881
1998-09-10 18:06:28 +00:00
cracauer
6e683a82b2 Fix an inefficiency I introduced in my last commit.
Include "expand.h" vom memalloc.c to pull function declartion into scope
1998-09-10 14:51:06 +00:00
cracauer
2bc1267a9c If traps are set, they are now executed even when a signal-blocking
foreground child is running. Formerly, traps were exceuted after the
next child exit.

The enables the user to put a breaking wrapper around a blocking
application:
  (trap 'echo trap ; exit 1' 2; ./pestyblocker; echo -n)

The "echo -n" after the child call is needed to prevent sh from
optimizing the trap-executing shell away. I'm working on this.
1998-09-08 13:16:52 +00:00
cracauer
51f504cdb4 Add -S flag to test for sockets.
PR:		bin/7507
Reviewed by:	I tested the patch
Submitted by:	Stefan `Sec` Zehl sec@42.org
1998-09-07 16:59:05 +00:00
tegge
f36aa446c7 Better handling of word splitting. Don't record the same region
multiple times when performing nested variable expansion, and
preserve some quoting information in order to avoid removing
apparently empty expansion result.
1998-09-06 21:13:09 +00:00
tegge
a860e83ccf Don't blindly eliminate `..' and the previous pathname component.
PR:		2541
Obtained from:	NetBSD
1998-09-06 21:01:57 +00:00
gpalmer
40e05a5967 Split lines into one subdir per line. 1998-08-30 20:22:15 +00:00
cracauer
faa80805b8 Improve bookkeeping of in_waitcmd and style fixes.
Submitted by:	Bruce Evans
1998-08-25 09:33:34 +00:00
cracauer
c7345be909 Re-enable killing childs with SIGQUIT. Spotted by Bruce Evans. 1998-08-25 08:49:47 +00:00
cracauer
2a3e4713ee Got two volatile sig_atomic_t and int mixed up. Spotted by Gary Palmer. 1998-08-24 19:15:48 +00:00
cracauer
8e91e03b52 Do not exit on SIGINT in non-interactive shells, fixes PR 1206,
i.e. this makes emacs usable from system(3). Programs called from
shellscripts are now required to exit with proper signal status. That
means, they have to kill themself. Exiting with faked numerical exit
code is not sufficient.

Exit with proper signal status if script exits on signal.

Make the wait builtin interruptable, both with and without traps set.

Use volatile sig_atomic_t where (and only where) appropriate.

(Almost) fix printing of newlines on SIGINT.

Make traps setable from trap handlers. This is needed for shellscripts
that catch SIGINT for cleanup work but intend to exit on it, hance
have to kill themself from a trap handler. I.e. mkdep.

While I'm at it, make it -Wall clean. -Wall is not enabled in
Makefile, since vararg warnx() macro calls in usr.bin/printf/printf.c
are not -Wall-able.
PR:		1206
Obtained from:	Basic SIGINT fix from Bruce Evans
1998-08-24 10:20:37 +00:00
jb
b4bc01338c Now that alpha uses FreeBSD syscalls, all these work. 1998-08-15 12:27:23 +00:00
dfr
e4f9ef383b Silence some warnings when building on the alpha. 1998-08-07 09:39:11 +00:00
markm
57b61e8f72 Fix LIBDIR (for aout/ELF). 1998-08-06 21:41:13 +00:00
peter
4aa8de6c93 Use sendmail-8.9.1 rmail (with our changes). 1998-08-04 15:19:16 +00:00
hoek
e36161539d Add missing "else", without whom the prev. commit is a null change.
Fix a 2nd level indentation style bug.
1998-08-02 22:47:11 +00:00
bde
3f732f34de Fixed printf format errors (time_t is not necessarily long). 1998-08-02 14:25:24 +00:00
jkoshy
856cedc623 Document behaviour of "-" and "--" on the command line.
PR: docs/5399
1998-07-30 04:47:56 +00:00
hoek
4f1070b467 Allow env. variable LS_COLWIDTHS to specify minimum column widths,
effectively overriding the dynamically-sized-column feature.  This
is mostly useful for non-interactive use, where it may be necessary
to ensure that listings taken at different times have columns that
line-up correctly.  I have been assured that at least one large,
well-known program will soon be taking advantage of this.  :-)

PR:		bin/7011
Submitted by:	Joel Ray Holveck <joelh@gnu.org>
1998-07-29 00:46:13 +00:00
nectar
0f39023431 Document the printf built-in. 1998-07-27 21:31:19 +00:00
nectar
428e532ccc csh built-in printf now expands arguments. e.g.
printf '%d\n' `echo 23`
now works as expected.
PR:		bin/2969
Submitted by:	Gareth McCaughan <gjm11@dpmms.cam.ac.uk>
1998-07-27 21:15:52 +00:00
jkoshy
3dcf71440e Fix use of -man macro, correct description of the behaviour of the `+n'
command to match whats there in the source.

PR: 7328
1998-07-21 04:53:18 +00:00
bde
44bb68bb37 Added a `build-tools' target for internal tools.
Removed explicit dependencies of foo.o on foo.c.  These were mainly
placeholders for comments about missing dependencies of tools objects
on headers.  This problem needs to be handled more generally.
1998-07-07 01:06:58 +00:00
phk
1a1b91e398 Pick up kernel variables/constants using sysctl rather than through /dev/mem
Use /dev/null for opening the kvm library, we don't need access to /dev/mem
anymore.

ps can now run without the setgid(kmem) bit.  If it does it will not be
able to show argv/envp for another uid's processes unless you are root.
1998-06-30 21:34:14 +00:00
bde
846df0ccd8 Fixed printf format errors (second round with non-i386 typedefs). 1998-06-28 21:05:48 +00:00
bde
f86a86c1b0 Fixed printf format errors. 1998-06-28 21:00:04 +00:00
bde
ae0ea8e208 Oops, the previous log message should have read "Fixed type mismatches -
don't assume that time_t is long".
1998-06-28 18:26:18 +00:00
bde
cd369d3872 Fixed printf format errors. 1998-06-28 18:19:13 +00:00
bde
a273612216 Fixed printf format errors. 1998-06-28 18:08:54 +00:00
jkoshy
9ae2dba8f6 Remove compile time dependency on ARG_MAX.
PR: 1791 (partial)
Reviewed by: Bruce Evans <bde@freebsd.org>, Tor Egge <tegge@freebsd.org>
1998-06-17 11:33:10 +00:00