Commit Graph

1794 Commits

Author SHA1 Message Date
David E. O'Brien
2edbecc6db Remove WFORMAT, style.Makefile(5). 2004-03-22 03:17:36 +00:00
Pawel Jakub Dawidek
3184e92100 When symbolic link is pointed onto a mount point, it can't be moved
to a different file system.
Patch in PR was incorrect.

PR:		bin/64430
Submitted by:	Samuel Tardieu
MFC after:	3 days
2004-03-21 13:38:37 +00:00
Tim J. Robbins
b59ca66070 Document incorrect handling of multibyte characters. 2004-03-21 11:24:06 +00:00
Tim J. Robbins
f791df19bd Document incorrect handling of multibyte characters in filenames. 2004-03-21 11:16:24 +00:00
Tim J. Robbins
744e4bba0e Reduce redundancy in the description of the -u option. 2004-03-21 11:04:59 +00:00
Tim J. Robbins
f74d4353ce Document incorrect handling of multibyte characters when -t and -v options
are used.
2004-03-21 11:02:40 +00:00
Dag-Erling Smørgrav
1afaec9ae4 Add a -v (verbose) option. 2004-03-21 04:56:06 +00:00
Ruslan Ermilov
4995f06772 Install /bin/sh safely. This allows a shell script to be used
to strip binaries by specifying it in the STRIPBIN environment
variable honoured by install(1).

MFC after:	3 days
2004-03-18 10:55:47 +00:00
Garance A Drosehn
2e6c6ac4d7 Fix 'ps -p proclist' and 'ps -u userlist' so the command returns non-zero
if no processes were matched.  Also sorts the list of 'int's in main, as
long as I had to add another one...

Noticed by:	Nate Lawson
MFC after:	10 days
2004-03-18 01:28:23 +00:00
Garance A Drosehn
4e8b6a6fb0 Improvements to 'ps -p <x>'. If <x> is a process id that does not exist, then
just print the header (if any) and exit, thus matching the behavior on -stable
and other OS's.

Also adds support for <x> being a comma-separated list of processes, and does
a much better checking for invalid-values of <x>, such as 'ps -p someword'.

Reviewed by:	mentioned on freebsd-current
MFC after:	10 days
2004-03-17 22:46:58 +00:00
Colin Percival
3ed29c96cf Fix memory leak
PR:		bin/64321
Submitted by:	Rodney Ruddock <rodney@interopsystems.com>
MFOpenBSD:	rev 1.17
MFC after:	3 days
2004-03-16 08:33:33 +00:00
Juli Mallett
c83afe7be9 static and const. 2004-03-15 04:10:29 +00:00
Lukas Ertl
ae21f5ad2c And a bandaid so that the output of "available space" is correct when
using -m and -g switches and "available space" is negative (i.e. when
the file system is already using the root-reserved minimum free space).

Obtained from:   Stefan Farfeleder <stefan@fafoe.narf.at>
PR:              bin/62536
Submitted by:    Peter van Dijk <peter@dataloss.nl>
Approved by:     grog (mentor), bde
2004-03-09 10:02:44 +00:00
Andrey A. Chernov
c65eeb736e Remove a.out at the end of 'make test' 2004-03-08 18:09:33 +00:00
Bruce Evans
d493ed0f97 Fixed some style bugs (mainly unsorting and tab lossage in previous commit). 2004-03-06 08:21:32 +00:00
Andrey A. Chernov
c6f22660ff Add a.out to CLEANFILES 2004-03-06 06:54:58 +00:00
Andrey A. Chernov
adde319c62 Change locale name from non-existent ASCII to en_US.US-ASCII 2004-03-06 06:10:16 +00:00
Poul-Henning Kamp
6a3d33ac5e Teach dd(1) about parity bits. 2004-03-05 19:35:51 +00:00
Poul-Henning Kamp
3d36fd4271 Add a test-target and reference vectors for the character converions. 2004-03-05 19:30:13 +00:00
Mark Murray
16fc3635f7 Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64
2004-03-05 08:10:19 +00:00
Mike Makonnen
662713f2a8 Rev. 1.32 moved a comment to the wrong line. The hack refered to
in the comment applies to a decision that needs to be made in relation
to the year 2000.

In fact, that statement probably should be changed to be
more generic (getting the year from the current time perhaps). Otherwise,
starting in 2069 two digit year conversions in date(1) will start assuming
1900 instead of 2000. hehe.
2004-03-04 15:46:14 +00:00
Colin Percival
310924af3d Fixes to output of ls -lh for certain file sizes:
1. Sizes in the range 1000 -- 1023 units require four characters width
   for the integer; increase the field width to accomodate this.
2. Sizes in the range 9.95 -- 10 units were being displayed as "10.0"
   units; adjust the logic to fix this, and now that we've got an extra
   character of field width, print fractional units if the size is less
   than 99.95 units.
3. Don't display sub-byte precision.

This should mean that the following sizes are displayed:
    0B .. 1023B
  1.0U ..  9.9U
 10.0U .. 99.9U
  100U .. 1023U
for values of U in "KMGTPE".

PR:		bin/63547
Pointy hat to:	cperciva
Approved by:	rwatson (mentor)
2004-03-01 19:25:27 +00:00
Johan Karlsson
c8edef9f48 style.Makefile:
Use WARNS?= instead of WARNS=
2004-02-23 20:05:14 +00:00
Daniel Eischen
d75c1d8381 Allow the -H option to show threads when selecting by uid, tty,
and pid.
2004-02-22 17:59:31 +00:00
Ceri Davies
3004d1ed4d Only call chflags() on directories once.
Approved by:	ru
MFC after:	1 week
2004-02-18 18:45:11 +00:00
Nate Lawson
aa0b7126ba style(9): wrap at 80 columns. 2004-02-12 05:05:56 +00:00
Nate Lawson
97054a769f Handle proper formatting and a buffer overrun when running an old sh on
a system that has sys_nsig > NSIG (i.e. when libc is upgraded.)

Submitted by:	Matt Dillon
Reviewed by:	bde
2004-02-12 05:03:37 +00:00
Juli Mallett
7cb9663b27 MFp4 @46705:
Support "uprocp" exactly like "paddr" with the former having been
documented in the manual but not implemented.

PR:		42484
2004-02-08 23:57:19 +00:00
Ian Dowse
0bd9f15133 Use int rather than size_t storage for printf field widths to avoid
many casts.

Reviewed by:	bde
2004-02-08 23:42:09 +00:00
Ruslan Ermilov
47d7e8a96f Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
Martin Cracauer
e637898ea8 Commit fix sent by Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
Only use return value from system call if system call succeeded.

Tested with `make world` and some of my own scripts.

This should be MFCed soon.  While /bin/sh is hard to test the fix is
obviously correct and can be assumed not to break something else
(famous last words...).
2004-02-05 22:34:05 +00:00
Nate Lawson
205bc8633e Use sys_nsig instead of the static NSIG. DragonflyBSD kill.c:1.3
Obtained from:	DragonflyBSD
2004-01-28 19:04:14 +00:00
Nate Lawson
1b13752a03 Use sys_nsig instead of NSIG for the length of the signal arrays. This
is important if we add new signals later.  From DragonflyBSD:
jobs.c:1.4, trap.c:1.3.

Obtained from:	DragonflyBSD
2004-01-28 19:01:10 +00:00
Martin Cracauer
6c6fd020de The PR diff I committed recently had one bug noticed by
Joe Marcus Clarke <marcus@FreeBSD.ORG>, subshells could lose a
non-zero exit status.

This commit is Joe's proposed patch.  Thanks!

I verified that the problem Joe found is fixed and I ran a full world
with this patch.

I don't plan to ever commit language patches to /bin/sh again.  It is
a minefield too big to navigate without a full-time committment, which
I am not willing to do on our /bin/sh.

Under normal circumstances I would recommend using NetBSD's sh which
has a lot of language fixes (like the ones what these patches were
about) but unfortunately they had implemented broken signal behaviour
for shellscript containing interactive programs.  Similar issues apply
to pdksh which is OpenBSD's sh.

From my perspective bash2 is the only really working bourne sh out
there and that one is GPLed.  Oh well.
2004-01-28 18:22:19 +00:00
Colin Percival
d3b68bf14c Fix alignment of size field in ls -lh -- the width was being computed
from log[10](largest file size), but when outputting in human-friendly
format the width is always at most 4. (eg. "123K", " 12K", "1.2K".)

PR: bin/59320
Approved by: rwatson (mentor)
2004-01-22 04:33:00 +00:00
Colin Percival
bcf85d6737 Bring ps.1 up to date with changes in the past seven years:
* Remove mention of '>', 'A', and 'S' states
* Mention 'W' state.
* List 'J' state in the correct location.
* Sync with flags in sys/proc.h

Approved by: rwatson (mentor)
MFC after: 7 days
2004-01-21 16:25:36 +00:00
Dag-Erling Smørgrav
7e1c72660f Replace home-grown dup2() implementation with actual dup2() calls. This
should slightly reduce the number of system calls in critical portions of
the shell, and select a more efficient path through the fdalloc code.

Reviewed by:	bde
2004-01-21 12:50:01 +00:00
Ruslan Ermilov
d0123622bb Removed duplicate y.tab.h from SRCS and CLEANFILES. 2004-01-20 13:13:40 +00:00
Ruslan Ermilov
d10a8d6cb4 - Build things in pure dictionary order (see sort(1)).
- Unify the conditional assignments section so that architectural
  exclusions come first, then options and !options, sorted by the
  option name, also in directory order, then architecture specific
  sections, sorted by the architecture name, with i386 being a
  traditional exception.

Prodded by:	bde
2004-01-16 15:23:19 +00:00
David E. O'Brien
ab579b9e93 Note the Linux required format. 2004-01-06 19:01:34 +00:00
Jun Kuriyama
b800f53d91 o Fix a style bug and poor wording in comment.
o When fts_read() cannot stat the file, it can't be unlinked.  At
  that case, don't display error message when -f flag is used.

Obtained from:	bde
PR:		kern/16815, bin/35842
Reported by:	kuriyama, Aleksandr A. Babaylov <.@babolo.ru>
2004-01-01 10:26:43 +00:00
Maxim Konovalov
8aa55d8126 o Spell 'diretories' correctly.
PR:		misc/60730
Submitted by:	Eugene Grosbein
MFC after:	3 days
2003-12-30 15:39:33 +00:00
Martin Cracauer
bd80d26f3b PR 28852
sh -e behaviour was incorrect when && and || statements where used in
"if" clauses.

This is the patch submitted by MORI Kouji <mori@tri.asanuma.co.jp>.

It fixes the issue at hand, but sh fixes like this are super-hard to
verify that they don't break anything else.  I ran some of my old test
cases and a few big GNU configure scripts that detected mistakes
before, with the previous sh, patched sh and bash.  No differences in
behaviour found.  MFC recommended after longer than usual time.

Compiles on i386 and sledge.
2003-12-28 02:05:12 +00:00
Ruslan Ermilov
887cb17fac Print unambiguous paths with -R -v. 2003-12-16 15:17:30 +00:00
Maxime Henrion
ec912781bb The uuidgen(1) program is WARNS=6 clean, so flag it as such.
Tested on:	i386, sparc64
2003-12-07 21:34:56 +00:00
David E. O'Brien
d5f9f41c7b Do something sensible if both -h and -k are given.
Approved by:	re(scottl)
2003-12-01 19:10:29 +00:00
Marcel Moolenaar
bd8477d623 Force a staticly linked /bin and /sbin for ia64. The necessary changes
to gcc have not been made for ia64, which means that executables still
have /usr/libexec/ld-elf.so.1 as the dynamic linker. This simply does
not work if /usr is a seperate filesystem not mounted when the kernel
tries to execute init(8).

Note that this is a temporary fix until a new gcc has been imported
that does have the required changes.

Approved: re@
2003-11-19 16:59:00 +00:00
Gordon Tetlow
7e83e0de77 Change the default for binaries in /bin and /sbin from statically to
dynamically linked. This has been a long time coming with the move of
critical libraries from /usr/lib to /lib. If you don't feel comfortable
with dynamically linked binaries in your root partition, now is the
time to define NO_DYNAMICROOT in your make.conf.

Approved by:	re
2003-11-16 04:57:28 +00:00
Alan Cox
b9e25f436b Don't mmap(2) and munmap(2) zero-length files.
Submitted by:	Wiktor Niesiobedzki <bsd@w.evip.pl>
2003-11-13 05:26:55 +00:00
Kris Kennaway
ea64ad7727 Fix format strings (intmax_t is %jd, not %qd)
Reviewed by:	tjr
2003-11-12 21:47:42 +00:00