Commit Graph

9950 Commits

Author SHA1 Message Date
Florian Smeets
f9cd2d0a8d Add myself to calendar.freebsd and committers-ports.dot
Approved by:	fjoe (mentor)
2010-12-07 23:56:51 +00:00
Jaakko Heinonen
cdfc719c2e Don't write the terminating NUL past end of buffer.
PR:		bin/152345
Submitted by:	Mateusz Guzik
2010-12-06 09:18:11 +00:00
Doug Barton
4221d3eb78 Bring in the change from NetBSD 1.28:
"\\ -> \e"

Obtained from:	joerg@NetBSD.org

Bump .Dd because we're now up to date with the latest NetBSD version
2010-12-05 22:47:08 +00:00
Doug Barton
c6281ac026 Bring in the following changes from NetBSD:
1.21
"Document the flags displayed by the default format, and mention their short
names. From espie@openbsd via jmc@openbsd."

1.24
"Fix three variable names.
From Todd T. Fries via Jason McIntyre."

Obtained from:	wiz@NetBSD.org (previous 2)

1.25
"Be consistent: document the birthtime field of struct stat for
the "B" field specifier."

Obtained from:	reed@NetBSD.org

1.26
"Drop trailing space."

Obtained from:	wiz@NetBSD.org

1.27
"Since we have st_birthtime in struct stat, it is in default display."

Obtained from:	enami@NetBSD.org

Purposely skipping the following revisions:
1.22	NetBSD-specific change
1.23	Removal of license clauses 3 and 4, already handled by imp
	in our r203971
2010-12-05 22:41:58 +00:00
Doug Barton
dc5e1d528e Bring in the change from NetBSD 1.20:
"Make sentence easier to parse. From jsing@openbsd via jmc@openbsd."

Obtained from:	wiz@NetBSD.org
2010-12-05 22:24:34 +00:00
Doug Barton
7c304a3b0f Bring in the changes from NetBSD 1.16 that we did not already have.
"Some fixes from jmc@openbsd."

Obtained from:	wiz@NetBSD.org
2010-12-05 22:20:08 +00:00
Doug Barton
d127a98c99 Bring in the changes from NetBSD 1.13 that we did not already have, with
some differences.

"Sort options. Use more mdoc macros. Some nit fixes. Bump date."

Obtained from:	wiz@NetBSD.org
2010-12-05 22:16:51 +00:00
Doug Barton
1c40e1f66c Bring in the change from NetBSD 1.12:
"document default format."

Obtained from:	yamt@NetBSD.org
2010-12-05 22:01:01 +00:00
Doug Barton
da78facc72 Bring in the following changes from NetBSD. See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128

1.29
"Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it
successfully prints mtimes after 2038."

1.30
"Improve previous with comments."

Obtained from:	dholland@NetBSD.org (both)
2010-12-05 21:53:12 +00:00
Doug Barton
d7233fd615 Fix an "unused variable" error that gets us all the way to WARNS=6 2010-12-05 21:33:05 +00:00
Doug Barton
9b3f439482 Bring in the update from NetBSD 1.28:
"Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)"

Because of code differences I had to hand-apply parts of the patch,
so responsibility for errors goes to me.

Obtained from:	lukem@NetBSD.org
2010-12-05 21:29:20 +00:00
Doug Barton
d29003e79e Bring in the update from NetBSD 1.19, the documentation of readlink -f
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from:	elad@NetBSD.org
2010-12-05 21:17:02 +00:00
Doug Barton
b9f9338ea8 Bring in a new feature, adding a -f option to readlink to print the path
of the target, similar to realpath(1). See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662

This brings in the following changes:
1.24
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from:	elad@NetBSD.org

1.25
"Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format."

Obtained from:	mlelstv@NetBSD.org

1.27
"The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable.  This fixes the missing " -> " in front of the real
path (when you use %SR).

Also, the ?: needs another space."

Obtained from:	atatat@NetBSD.org

I am purposely omitting the following changes:
1.23	A humanize_number(3) clone that should better be implemented by
	actually using humanize_number(3)
1.26	This is the removal of license clause 3 and 4, already handled
	by imp in r203971
2010-12-05 21:11:45 +00:00
Doug Barton
578800b575 Bring in the change from NetBSD 1.22:
"Fix a trivial truncation case, and eliminate a corner case that might
print a nul character."

I am purposely bypassing the following versions:
1.19	A build infrastructure change that does not apply to us
1.20	A feature I am not interested in, but don't object if someone else
	wants to pick it up
1.21	A build infrastructure change that does not apply to us

Obtained from:	atatat@NetBSD.org
2010-12-05 20:47:53 +00:00
Doug Barton
5c06c8a134 Add my own documentation for the change in our r216196, aka NetBSD's 1.18
For -L if stat(2) fails, fall back to lstat(2).

.Dd purposely not bumped because more changes are coming.
2010-12-05 09:35:07 +00:00
Doug Barton
ccdbe8ce16 Bring in the change from NetBSD 1.18:
"If using stat (the -L flag) and it fails, fall back to lstat().  It
may be the case that we're examining a broken symlink, and anything is
better than nothing."

The changes in 1.14 through 1.17 were not relevant to us.

Obtained from:	atatat@NetBSD.org
2010-12-05 09:33:04 +00:00
Ulrich Spörlein
cded07a878 Move most of the remaining USD/PSD/SMM papers into share/doc 2010-12-04 10:11:20 +00:00
Gordon Tetlow
57cd97175a Add ability to decompress different format manual pages.
Add support for .so directive in manual pages.

Approved by:	mentor (wes@)
2010-12-03 02:07:34 +00:00
Xin LI
706d26a4a4 Decode IPC_CREAT and IPC_EXCL for semget(2).
PR:		bin/152781
Submitted by:	Anton Yuzhaninov <citrin citrin ru>
MFC after:	2 weeks
2010-12-02 18:24:22 +00:00
Kevin Lo
e66a677b27 Don't error out while searching for empty directories.
Submitted by:	Bakul Shah <bakul at bitblocks dot com>
2010-12-02 01:46:06 +00:00
Kai Wang
773810fb45 Add option -D for ranlib(1). When -D is speicified, ranlib(1) will generate
a deterministic archive symbol table (i.e. timestamp for the symbol table
member header is set to 0).

Submitted by: 	 Erik Cederstrand
2010-11-28 18:53:57 +00:00
Rebecca Cran
a709913fdd Fix typo. 2010-11-27 21:35:16 +00:00
Ulrich Spörlein
9c4bab2ddc Pet make checkdpadd. 2010-11-25 19:22:24 +00:00
Nathan Whitehorn
b396ac3d0f Properly use SCHAR_MAX instead of CHAR_MAX for 0x7f. This fixes operation
of locate(1) on systems on which char is unsigned by default (ARM and
PowerPC).

Reported by:	Paul Mather
MFC after:	4 days
2010-11-23 15:08:56 +00:00
George V. Neville-Neil
b205d03d78 Restore the (state) and \n printout when not using -T.
Pointed out by:	brucec@
MFC after:	3 weeks
2010-11-22 22:55:43 +00:00
Rebecca Cran
70557f4f83 hdr.elf.e_ident[EI_OSABI] is not a bitmask so '==' should been used.
Reported by: Artem Belevich <fbsdlist at src.cx>
2010-11-22 20:18:46 +00:00
Rebecca Cran
1161d4202c Fix some more warnings found by clang. 2010-11-22 20:10:48 +00:00
Attilio Rao
7f08176ee8 Add the ability for GDB to printout the thread name along with other
thread specific informations.

In order to do that, and in order to avoid KBI breakage with existing
infrastructure the following semantic is implemented:
- For live programs, a new member to the PT_LWPINFO is added (pl_tdname)
- For cores, a new ELF note is added (NT_THRMISC) that can be used for
  storing thread specific, miscellaneous, informations. Right now it is
  just popluated with a thread name.

GDB, then, retrieves the correct informations from the corefile via the
BFD interface, as it groks the ELF notes and create appropriate
pseudo-sections.

Sponsored by:	Sandvine Incorporated
Tested by:	gianni
Discussed with:	dim, kan, kib
MFC after:	2 weeks
2010-11-22 14:42:13 +00:00
Rebecca Cran
e267ef95d5 Don't generate input() since it's not used. 2010-11-22 14:16:22 +00:00
Stephen McKay
29afe03fd1 Various syntactic tweaks to satisfy style(9). No change to execution.
Submitted by:	gcooper@
2010-11-21 21:31:29 +00:00
Stephen McKay
92095ab601 xargs can be fooled by exiting children that it did not start, causing
it to kick off a new command before the previous has finished, resulting
in corrupted (interleaved) output.  It is also fooled by non-exiting
children it did not start, failing to exit until all extraneous children
have exited.

This patch makes xargs keep track of children it starts, ignoring
pre-existing ones.
2010-11-21 10:55:16 +00:00
Kevin Lo
a48551fac2 Remove unused variable 2010-11-20 15:22:16 +00:00
Jilles Tjoelker
9897c45f31 sh: Add printf builtin.
This was removed in 2001 but I think it is appropriate to add it back:
* I do not want to encourage people to write fragile and non-portable echo
  commands by making printf much slower than echo.
* Recent versions of Autoconf use it a lot.
* Almost no software still wants to support systems that do not have
  printf(1) at all.
* In many other shells printf is already a builtin.

Side effect: printf is now always the builtin version (which behaves
identically to /usr/bin/printf) and cannot be overridden via PATH (except
via the undocumented %builtin mechanism).

Code size increases about 5K on i386. Embedded folks might want to replace
/usr/bin/printf with a hard link to /usr/bin/alias.
2010-11-19 12:56:13 +00:00
Kevin Lo
b00f982843 Fix fd leak
MFC after:	3 days
2010-11-19 10:18:58 +00:00
Kevin Lo
f9af8a7b9c Close file and directory descriptors
MFC after:	3 days
2010-11-19 10:15:29 +00:00
Ryan Stone
3c578b2a05 When netstat was run with -i/-I and -w1 to produce running counters, the idrop
field printed an absolute value rather than the delta from the last value

Approved by:	emaste (mentor)
MFC after:	1 week
2010-11-18 23:46:55 +00:00
George V. Neville-Neil
f5d34df525 Add new, per connection, statistics for TCP, including:
Retransmitted Packets
Zero Window Advertisements
Out of Order Receives

These statistics are available via the -T argument to
netstat(1).
MFC after:	2 weeks
2010-11-17 18:55:12 +00:00
Rebecca Cran
4784a27247 Memory stats are reported in bytes, not pages.
PR:	docs/151283
Submitted by:	Bas Smeelen <b.smeelen at ose.nl>
MFC after: 3 days
2010-11-13 11:43:20 +00:00
Jaakko Heinonen
e04c378683 Set FD_CLOEXEC for the output file only when the file has been specified
with the -o option. Setting the flag for stderr (the default) could
cause the traced process to redirect stderr to a random file.

PR:		bin/152151
Submitted by:	ashish
MFC after:	5 days
2010-11-13 09:28:49 +00:00
Zack Kirsch
88d196db30 Add my birthday to the calendar so everyone can send me presents.
Approved by: zml (mentor)
2010-11-10 18:45:32 +00:00
Ulrich Spörlein
91109a91ba Unbreak the test target by re-generating the initial scanner
using an updated flex(1) binary.

Also ignore the changing $FreeBSD$ ID lines when doing the diff.
This needs additional obfuscation, to not upset the svn precommit
hooks :/
2010-11-09 18:28:11 +00:00
Rebecca Cran
b1ce21c6ef Fix typos.
PR:	bin/148894
Submitted by:	olgeni
2010-11-09 10:59:09 +00:00
David E. O'Brien
6d4a0c96d3 Fix the build on 64-bit hosts. WARNS=6 fails on them. 2010-11-09 02:51:38 +00:00
David E. O'Brien
2d15e75781 Back out r214961 for skeleton.c -- it broke the groff build. 2010-11-08 19:00:22 +00:00
Ruslan Ermilov
ecfd40f14d Add/expand country/state. 2010-11-08 09:50:47 +00:00
Ruslan Ermilov
2a000d9c8c A traditional (once per three years) sort by month/day/year/login.
While here, fixed badly formatted lines.
2010-11-08 09:26:56 +00:00
David E. O'Brien
7846096d2b Add '-y' for bison compatibility.
Obtained from:	http://invisible-island.net
2010-11-07 23:44:40 +00:00
David E. O'Brien
c81609f43f Inherit WARNS from parent directory.
Submitted by:	marius
2010-11-07 23:34:05 +00:00
David E. O'Brien
92a010d28b Directly use memory allocation functions and remove needless casts in
their usage.  Also use associated modern types instead of k&r ones.
2010-11-07 23:22:42 +00:00
David E. O'Brien
f5015507b0 Change to ANSI-C function definitions. 2010-11-07 22:51:54 +00:00
Ulrich Spörlein
446c7ab86a Retire objformat(1), take two.
It's been almost four years, and this placeholder has not been needed.
2010-11-07 10:49:40 +00:00
Jean-Sébastien Pédron
76423301d3 Fix a segmentation fault in argument processing.
The crash was caused by a command line such as this one:
# foldl -b1

PR:		bin/151592
Reported by:	Marcus Reid <marcus@blazingdot.com>
Tested by:	Marcus Reid <marcus@blazingdot.com>
MFC after:	3 days
2010-11-06 17:48:46 +00:00
Ulrich Spörlein
9283118f01 Apply style(9) and unbreak build.
This went unnoticed during the WARNS bump, as this tool is not connected
to the build.
2010-11-06 15:04:56 +00:00
Ulrich Spörlein
9e411c4821 Fix manpage markup. 2010-11-06 10:54:33 +00:00
John Baldwin
c23d84a86b Correct the abbreviations for general I/O and signal traces.
PR:		docs/151854
Submitted by:	Stephen Veiss  stephen of brokenbottle net
MFC after:	3 days
2010-11-01 15:18:57 +00:00
Garrett Wollman
ab10162f86 Style cleanup: make this look more like a 21st-century shell script
and not something out of the early 1980s.  Make sure all error
messages go to stderr, not stdout.  Since there's error-handling code
to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization
form that allows this error to be diagnosed.  (hat tip: jilles@)
2010-11-01 02:20:18 +00:00
Garrett Wollman
bf59c7bab7 jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh
made it impossible to override PRUNEDIRS to make it empty.  Use the
non-colon form to only set PRUNEDIRS if it is completely unset.  (For
parallelism, the other configuration defaults here could be done the
same way, but that could be more obviously accomplished by disabling
updatedb in periodic.conf, so leave them alone for now.)
2010-11-01 01:51:47 +00:00
Garrett Wollman
6f8b6f9469 Make it possible to exclude directories by name no matter where they
are in the filesystem from the locate database.  By default, exclude
".zfs" directories, as users who who have set snapdir=visible and are
taking frequent snapshots most likely do not want the snapshots
included in the locate database.
2010-10-31 02:36:05 +00:00
Ulrich Spörlein
16dc6e122a flex: add missing ifdef magic to create/hide prototypes
This unbreaks build for some software with higher WARNS flags.

Reviewed by:	rpaulo
PR:		bin/139319 (parts already committed in previous revision)
2010-10-24 15:31:41 +00:00
Gleb Smirnoff
283e21dd32 Fix typo in last commit.
Submitted by:	bcr
2010-10-21 20:22:00 +00:00
Gleb Smirnoff
f3d45e1409 Document possibility to read from stdin. 2010-10-21 17:23:09 +00:00
Gleb Smirnoff
85080d2d68 Make it possible to read input from stdin.
Without this change I don't see a way to
unpack a multivolume archive without wasting
disk space for a temporary file.
2010-10-21 17:05:15 +00:00
Ulrich Spörlein
2914feeb7e mdoc: make pages render with mandoc
It's a bit more pedantic regarding .Bl list elements. This has an added
benefit of unbreaking the ipfw(8) manpage, where groff was silently
skipping one list element.
2010-10-21 12:27:13 +00:00
Ed Schouten
587250b286 Get rid of hand-rolled closefrom(3). 2010-10-20 19:53:29 +00:00
Ed Schouten
a2995e0d9b Remove setpgid() call before executing child process.
Using a separate process group here is bad, since (for example) job
control in the TTY layer prevents interaction with the TTY, causing the
child process to hang.

Mentioned on:	current@
MFC after:	2 weeks
2010-10-20 09:35:20 +00:00
Xin LI
4f2bbc00f2 MFV: nc(1) from OpenBSD 4.8.
While I'm there, bump WARNS level to 2 as the vendor
have the right printf format string now.

MFC after:	1 month
Obtained from:	OpenBSD
2010-10-19 00:01:53 +00:00
Frederic Culot
62778483f7 Replace spaces by a tab after the date.
Reported by:	gavin@, brucec@
Approved by:	sahil@ (mentor)
2010-10-18 19:14:59 +00:00
Edwin Groothuis
2d2d15a964 "b64decode -r" did not handle arbitary breaks in base64 encoded
data. White space should be accepted anywhere in a base64 encoded
stream, not just after every chunk (4 characters).

Test-scenario:

VmVsb2NpdHkgUmV3YXJkcw==

and

VmVsb2NpdHkgUmV3YXJkcw
==

should both produce "Velocity Rewards"

PR:		bin/124739
Submitted by:	Mark Andrews <marka@isc.org>
MFC after:	2 weeks
2010-10-18 05:44:11 +00:00
Edwin Groothuis
4b26f3413e Stylify of uudecode(1)
Part of PR bin/124739.

PR:		bin/124739
Submitted by:	Mark Andrews <marka@isc.org>
2010-10-18 03:59:55 +00:00
Frederic Culot
d688106259 Add myself to calendar.freebsd.
Approved by:	sahil@ (mentor)
2010-10-17 19:02:42 +00:00
Benedict Reuschling
c4fadc2b78 Correct some typos in comments, no functional changes. 2010-10-16 15:24:04 +00:00
Edwin Groothuis
9a865043bb Update manual with regarding to the status of calendars/calendar.judaic. 2010-10-14 21:53:25 +00:00
Benedict Reuschling
05844c563e s/sytem/system in comments, no functional changes.
Reviewed by:    alfred@
2010-10-13 20:08:02 +00:00
Rui Paulo
60982546cd Don't define the input() function ifdef YY_NO_INPUT.
This was previously done for the input() function.

Submitted by:	Norberto Lopes <nblopes.ml at gmail.com>
2010-10-13 10:31:32 +00:00
Martin Matuska
e0f0e66dfe Upgrade xz to git snapshot as of 20101010
Approved by:	delphij (mentor)
MFC after:	1 month
2010-10-11 21:16:50 +00:00
Tim Kientzle
0e479ac8f7 Add -D (deterministic) option to ar.
When set, it forces all timestamps and owners to zero and
modes to 0644.  Useful for producing libraries that are
bitwise identical across multiple build runs.

Submitted by:	Erik Cederstrand
Reviewed by:	Kai Wang
2010-10-09 05:31:08 +00:00
Dimitry Andric
93f8854c00 Remove superfluous cast in usr.bin/netstat/sctp.c.
Found by:	clang
Submitted by:	Norberto Lopes, nlopes dot ml at gmail dot com
Approved by:	rpaulo (mentor)
2010-10-08 20:40:05 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Gordon Tetlow
3d9127f1bc Add the ability to display specific manual pages if passed on the
commandline. This mirrors the old (undocumented) GNU man functionality.
Also document this feature in the implementation notes section of
the manpage.

Submitted by:	arundel
Approved by:	wes (mentor implicit)
2010-10-07 06:34:47 +00:00
Warner Losh
9a6945bc4a Remove hack needed by 6.x machines and older machines to run newer
makes on FreeBSD/pc98.  The need for this hack has passed.  If you are
one of the rare people that may need this, then you should setenv
MACHINE=pc98 as a workaround.
2010-10-06 20:54:17 +00:00
Warner Losh
2a13464829 Use more portable errx instead of errc. The latter doesn't buy us
anyting anyway, since the error EAGAIN's error message doesn't add
anything to the error strings that are there now.
2010-10-06 20:49:45 +00:00
Sergey Kandaurov
b44f9e2fc0 Add myself to calendar.freebsd and committers-src.dot.
Approved by:	avg (mentor)
2010-10-06 14:43:37 +00:00
Alexander Leidinger
57db56459a Fix regex for some socket- and acl-related syscall values.
Submitted by:	Mikhail <hidden.node@gmail.com>
PR:		149295
MFC-after:	2 weeks
2010-10-06 12:41:42 +00:00
Gordon Tetlow
1d7c660a13 If LANG/LC_CTYPE/LC_ALL is set and the localized man page contains a page
also in the base set, the man utility when invoked with -a would display
pages for each locale in the same tree:

$ LANG=en_GB.ISO8859-15 man -wa man
/usr/share/man/en.ISO8859-15/man1/man.1.gz
/usr/share/man/man1/man.1.gz
/usr/share/man/en.ISO8859-15/man7/man.7.gz
/usr/share/man/man7/man.7.gz

Use continue to break out of the loop for the current locale. This results
in behavior more closely matching the old GNU man implementation:

$ LANG=en_GB.ISO8859-15 man -wa man
/usr/share/man/en.ISO8859-15/man1/man.1.gz
/usr/share/man/en.ISO8859-15/man7/man.7.gz

This will still search for a copy of the file in other manual path
locations. If there was a /usr/local/man/man1/man.1.gz file, it would still
be displayed. This is also consistent with the GNU man implementation.

Submitted by:	arundel
Approved by:	wes (mentor implicit)
2010-10-06 07:22:56 +00:00
Tim Kientzle
80f68bebbd Recognize both ! and ^ as markers for negated character classes.
Submitted by:	Mykola Dzham
2010-10-06 04:30:40 +00:00
Christian Brueffer
e809783da2 SEE ALSO should sorted by manpage section first. 2010-10-05 20:39:36 +00:00
Gordon Tetlow
7230d5e626 Add reference to intro(1) in SEE ALSO section.
PR:		docs/151216
Approved by:	wes (mentor, implicit)
2010-10-05 16:14:08 +00:00
Ruslan Ermilov
699ef999ee Show hostcache statistics.
Submitted by:	Maxim Dounin
2010-10-05 05:15:27 +00:00
Gordon Tetlow
023f0373a1 Retire GNU man in favor of the newly written BSDL version.
Approved by:	wes (mentor)
2010-10-03 22:24:14 +00:00
Gordon Tetlow
00e05e697e Fix up whatis/apropos issue displaying all output on a single due to
forgotten quotes.

Submitted by:	Brandon Gooch
Approved by:	wes (mentor, implicit)
2010-10-02 06:55:04 +00:00
Gordon Tetlow
c535eb59d1 Implementaiton of man, manpath, whatis, and apropos written entirely in sh.
Features of this new version in favor of the old one:
BSD licensed -- old one is GPL.
Imports configuration from /etc/man.conf and LOCALBASE/etc/man.d/*.conf
allowing ports to extend the base functionality. The pluggable
configuration can supplement the manual search path (retiring use.perl),
add locales, and override language specific toolsets (attempt to merge
the japanese/man port into the base system as much as possible).

Much effort has been made to make this version mirror the functionality
of the existing implementation. For 99% of users, it should be a drop in
replacement.

PR:		gnu/143271, gnu/4419
Reviewed by:	dougb (previous versions)
Approved by:	wes (mentor)
2010-10-01 03:59:18 +00:00
John Baldwin
6d6bc99ad2 If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead
of faulting, check for NULL.  However, returning an error would cause csup
to just abort the entire update.  Instead, break out of the loop and
return ok.  The attempts to update the file will trigger a MD5 failure which
will cause csup to download the entire file as a fixup.

Reviewed by:	lulf
MFC after:	1 week
2010-09-30 14:28:48 +00:00
Jilles Tjoelker
88deede54a tr: Fix '[=]=]' equivalence class.
A closing bracket immediately after '[=' should not be treated as special.

Different from the submitted patch, a string ending with '[=' does not cause
access beyond the terminating '\0'.

PR:		bin/150384
Submitted by:	Richard Lowe
MFC after:	2 weeks
2010-09-29 22:24:18 +00:00
Ed Maste
905571c031 Remove copyright strings printed at login time via login(1) or sshd(8).
It is not clear to what this copyright should apply, and this is in line
with what other operating systems do.

For ssh specifically, printing of the copyright string is not in the
upstream version so this reduces our FreeBSD-local diffs.

Approved by:	core, des (ssh)
2010-09-28 20:57:14 +00:00
Dimitry Andric
0d2d8fab68 Add manpages for clang and tblgen. These were generated from upstream's
tools/clang/docs/tools/clang.pod and docs/CommandGuide/tblgen.pod,
respectively.

Approved-by:	rpaulo (mentor)
2010-09-27 19:03:18 +00:00
Marius Strobl
04ebad3842 Make WARNS=6 clean.
MFC after:	1 week
2010-09-24 10:40:17 +00:00
Marius Strobl
e865ab086c Try to adhere to style.Makefile(5).
MFC after:	3 days
2010-09-23 14:06:15 +00:00
Marius Strobl
ce7704b610 Remove an explicit assignment of the CFLAGS variable intended for
debugging purposes only.

MFC after:	3 days
2010-09-23 10:03:03 +00:00
Xin LI
fb2924e4ac In the past gunzip(1) write()'s after each inflate return. This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by:	iXsystems, Inc.
Reported by:	jpaetzel
MFC after:	2 weeks
2010-09-23 01:24:33 +00:00
Edwin Groothuis
e160180ef7 And now the 2nd part of the patch: Also fix the year.
PR:		150504
Submitted by:	Douglas Berry <bitnix@bitnix.ca>
2010-09-22 21:14:18 +00:00
Edwin Groothuis
778efe6079 Fix location of the Battle of the Plains of Abraham
PR:		150504
Submitted by:	Douglas Berry <bitnix@bitnix.ca>
MFC after:	1 week
2010-09-22 21:10:45 +00:00
Sunpoet Po-Chuan Hsieh
e5d8eb431b Add myself as a ports committer
Approved by:	pgollucci (mentor)
2010-09-22 16:54:22 +00:00
Xin LI
f7482a2568 Add Simplified Chinese messages for BSD grep. 2010-09-20 19:42:52 +00:00
Dimitry Andric
e580952d8a Upgrade our Clang in base to r114020, from upstream's release_28 branch.
Approved-by:	rpaulo (mentor)
2010-09-20 16:43:17 +00:00
David E. O'Brien
aa2e033466 Fix the grammar after I added a second environmental variable.
Submitted by:	wxs
2010-09-19 00:36:26 +00:00
David E. O'Brien
e5bc6d56e8 Increase the hostname display width. Many machines are named
with >12 characters.  This still allows for 80 column output
with load averages of 99.99, 99.99, 99.99.
2010-09-16 22:38:27 +00:00
David E. O'Brien
9b91846ce4 + Add the SCRIPT environmental variable to the sub-shell. Its value is
the name of the typescript file.
+ Add the 'command' argument (if supplied on the command line) to the
typescript file.  This creates a more complete typescript when invoked
this way - more equal to invoking script without supplying the 'command'
argument.
2010-09-16 22:31:03 +00:00
Rui Paulo
bd0f1ee24f Fix indenting of the previous commit. 2010-09-16 11:40:41 +00:00
Rui Paulo
836450ab23 When generating functions to print the arguments of system calls with
bitwise parameters (e.g. mmap), print the syscall parameter value first.
The resulting output looks like the %b specifier of printf(9).

Before:
mmap(0,0x8000,PROT_READ|PROT_WRITE,...
After:
mmap(0,0x8000,0x3<PROT_READ|PROT_WRITE>,...

Submitted by:	Norberto Lopes <nlopes.ml at gmail.com>
Idea from:	freebsd-arch/2006-April/005116.html
2010-09-16 11:33:31 +00:00
Ed Maste
b3f4d7e17c Remove extra ; 2010-09-14 01:33:21 +00:00
Warner Losh
8cfc82586e Move to using Makefile.arch to include the proper target-specific programs. 2010-09-13 15:30:09 +00:00
Warner Losh
336c4b45ea Doh! two last second refactoring typos crept in. Fix. 2010-09-13 06:50:07 +00:00
Warner Losh
d2fb1699ac Revert r212513 and reimplement the search order to be ARCH, CPUARCH 2010-09-13 06:35:35 +00:00
Warner Losh
22e2f727d0 Merge from tbemd: Move to using Makefile.arch to control what's build.
Reviewed by:	(arch@, no objection)
2010-09-13 02:23:03 +00:00
Warner Losh
9cbda5febf merge powerpc and powerpc64 now that we use TARGET_CPUARCH 2010-09-13 01:20:53 +00:00
Warner Losh
1136c95ff4 Move to using TARGET_CPUARCH instead of TARGET_ARCH. 2010-09-13 01:00:48 +00:00
David E. O'Brien
4b2f915321 Note bug in trying to printf(1) things like: '-%s\n' "foo" 2010-09-09 19:27:40 +00:00
Alexander Motin
4b06d6510d For total interrupt count on -vm screen count all interrupts, but not only
those which fit the screen.
2010-09-08 07:30:46 +00:00
Glen Barber
58175a74fc Fix typo in bsdcpio manual:
s/libarchive_formats/libarchive-formats

PR:		150300
Submitted by:	Kurt Jaeger <fbsd-pr at opsec dot eu>
Patch by:	Kurt Jaeger
Approved by:	keramida (mentor)
MFC after:	1 week
2010-09-06 20:40:38 +00:00
Andreas Tobler
33eb2576c1 Add myself to calendar.freebsd and committers-src.dot.
Approved by:	nwhitehorn	(mentor)
2010-09-06 19:00:00 +00:00
Jilles Tjoelker
3cf53e8550 printf(1): Clarify that \OOO produces a byte, different %b escape sequences.
Octal escape sequences are expanded to bytes, not characters, and multiple
are required for a multibyte character.

The valid escape sequences in %b strings are slightly different from the
escape sequences in the format string.
2010-09-05 21:44:50 +00:00
Steve Wills
58ab8e3f66 Add myself to calendar.freebsd
Approved By: pgollucci (co-mentor)
2010-09-05 01:57:25 +00:00
Edwin Groothuis
287cf3e528 Adding a missing firstname (Monique)
PR:		conf/150049
Submitted by:	Thierry Thomas <thierry@pompo.net>
2010-09-02 21:48:35 +00:00
Gavin Atkinson
f806ea8af1 Correct spelling mistake, int -> into
MFC after:	3 days
2010-09-02 21:29:50 +00:00
Kevin Lo
34759932a8 For consistency, cast result of getpid() to long 2010-08-31 07:19:10 +00:00
Edwin Groothuis
c31776f0f8 For calendars which don't match the solar-based Gregorian calendar,
be able to specify a year string in an entry.
2010-08-30 22:45:32 +00:00
Edwin Groothuis
746b67cdfa Use basename(3) to determine the name of the program.
Submitted by:	Alexander Best <arundel@>
2010-08-30 22:24:26 +00:00
Dimitry Andric
a4703857ff Add myself to calendars.freebsd.
Approved by:	rpaulo (mentor)
2010-08-30 21:20:24 +00:00
Nathan Whitehorn
4e5833219a Fix breakage introduced in r211725 and improve functionality of truss on
64-bit powerpc by adding 32-bit compatibility features.
2010-08-28 15:04:53 +00:00
Sergey A. Osokin
3e1700a5f8 Add one more new memory day for Russian Federation: the end of Second World War.
Obtained from:	http://kremlin.ru/acts/8444
2010-08-25 18:11:01 +00:00
Warner Losh
25faff346c MFtbemd:
Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
2010-08-23 22:24:11 +00:00
Gabor Kovesdan
6608cc579e - Change default grep back to GNU version. BSD grep can be built with the
WITH_BSD_GREP knob.
- Bump __FreeBSD_version

Requested by:   dougb
Approved by:    delphij (mentor)
2010-08-23 10:04:26 +00:00
Xin LI
c38208ad5e Revert a minor part of revision 211364:
- Imply -h if single file is grepped, this is the GNU behaviour

This is already done by code above the change and have caused a regression
since this instance of code does not check Hflag.

Reported by:	davidxu
Pointy hat to:	delphij
2010-08-19 22:55:17 +00:00
Edwin Groothuis
6edc7d2994 '\0' -> 0
Fix silly mistake by being overly zeaolous[sp] of applying the style rules.
2010-08-19 21:59:39 +00:00
Dag-Erling Smørgrav
a0ef9ad699 UTFize my name. 2010-08-19 09:28:59 +00:00
Xin LI
c38fa7e016 Check return value of dup(), it could be -1 when the system is running
out of file descriptors for instance.

Found with:	Coverity Prevent(tm)
CID:		6084
MFC after:	1 month
2010-08-19 01:34:00 +00:00
Gabor Kovesdan
3ed1008b89 - Refactor file reading code to use pure syscalls and an internal buffer
instead of stdio.  This gives BSD grep a very big performance boost,
  its speed is now almost comparable to GNU grep.

Submitted by:	Dimitry Andric <dimitry@andric.com>
Approved by:	delphij (mentor)
2010-08-18 17:40:10 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Ed Schouten
e8efeec6c5 Mark functions and variables as static.
All these functions and variables are local to this compilation unit, so
there is no reason why we shouldn't mark them static. This slightly
reduces the binary size.
2010-08-16 12:19:36 +00:00
Gabor Kovesdan
59218eb770 - Revert strlcpy() changes to memcpy() because it's more efficient and
former may be safer but in this case it doesn't add extra
  safety [1]
- Fix -w option [2]
- Fix handling of GREP_OPTIONS [3]
- Fix --line-buffered
- Make stdin input imply --line-buffered so that tail -f can be piped
  to grep [4]
- Imply -h if single file is grepped, this is the GNU behaviour
- Reduce locking overhead to gain some more performance [5]
- Inline some functions to help the compiler better optimize the code
- Use shortcut for empty files [6]

PR:		bin/149425 [6]
Prodded by:	jilles [1]
Reported by:	Alex Kozlov <spam@rm-rf.kiev.ua> [2] [3],
		swell.k@gmail.com [2],
		poyopoyo@puripuri.plala.or.jp [4]
Submitted by:	scf [5],
		Shuichi KITAGUCHI <ki@hh.iij4u.or.jp> [6]
Approved by:	delphij (mentor)
2010-08-15 22:15:04 +00:00
Xin LI
65a13e8549 Update a stale comment about grep. 2010-08-11 18:23:26 +00:00
Rui Paulo
bf7cda5121 Teach elfdump(1) about the SUNW_dof section.
Sponsored by:	The FreeBSD Foundation
2010-08-11 18:02:48 +00:00
Kevin Lo
f5f8c098c7 Use NULL instead of 0 when setting up pointer. 2010-08-10 06:58:12 +00:00
Tim Kientzle
c459cbeb2b Fix -R when used with -p. Previously, the
uname and gname weren't overwritten, so the
disk restore would use those to lookup the
original uid/gid again.  Clearing the uname
and gname prevents this.

Reported by: swell.k
MFC after: 7 days
2010-08-08 01:25:33 +00:00
Joel Dahl
f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Gabor Kovesdan
7b376a6917 - Some fixes to Ukranian catalog
Submitted by:	avg, Alex Kozlov <spam@rm-rf.kiev.ua>
2010-08-06 10:34:48 +00:00
Joel Dahl
60e1759be6 Don't point users at the old csup homepage.
Approved by:	lulf
2010-08-05 18:26:03 +00:00
Ulrich Spörlein
c0da74038d mdoc: make sure to pass at least one argument to quotation macros 2010-08-02 13:11:35 +00:00
Joel Dahl
ff9923c869 Fix typos. 2010-08-01 09:10:09 +00:00
Joel Dahl
a4f5b3dfeb Fix spelling. 2010-07-30 14:05:20 +00:00
Ulrich Spörlein
32ba16b6e6 Fix a couple of typos.
PR:		docs/148891
Submitted by:	olgeni
MFC after:	1 week
2010-07-30 11:58:18 +00:00
Gabor Kovesdan
2759539b90 - Add Ukranian catalog
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua>
2010-07-30 11:07:24 +00:00
Gabor Kovesdan
97a012f24a - Some minor changes to the messages to increase usefulness of error msgs
Reviewed by:	hrs (Japanese catalogs),
		pluknet <pluknet at gmail dot com> (Russian catalog)
Approved by:	delphij (mentor)
2010-07-29 18:02:57 +00:00
Gabor Kovesdan
cb534a9a52 - Add Japanese NLS catalogs
Submitted by:	hrs
Approved by:	delphij (mentor)
2010-07-29 01:15:26 +00:00
Gabor Kovesdan
55e44f511d - Use the traditional behaviour for filename and directory name inclusion
and exclusion patterns [1]
- Some improvements on the exiting code, like replacing memcpy with
  strlcpy/strcpy

Approved by:	delphij (mentor)
Pointed out by:	bf [1], des [1]
2010-07-29 00:11:14 +00:00
Baptiste Daroussin
6156467d68 Add myself as a ports committer
Approved by:	tabthorpe@ (co-mentor)
2010-07-28 16:38:37 +00:00
Gabor Kovesdan
36bcf7c1fb - Fix -l and -L by really surpressing output and just showing filenames
Submitted by:	swell.k@gmail.com
Approved by:	delphij (mentor)
2010-07-25 18:57:48 +00:00
Gabor Kovesdan
2711628675 - Fix --color behaviour to only output color sequences if stdout is a tty
or if forced mode is specified [1]
- While here, add some alternative names for the options and make then
  case-insensitive
- Fix -q and -l behaviour [2]
- Some small changes to make the code easier to review

Submitted by:   swell.k@gmail.com [1],
                dougb [2]
Approved by:    delphij (mentor)
2010-07-25 08:42:18 +00:00
Xin LI
0c41ffb3d4 Fix crashes when using grep -R:
- Explicitly pre-zero memory for fts_open parameters.
 - Don't test against directory patterns when we are testing direct
   leaf of current directory.

While I'm there plug a few of memory leaks.
2010-07-23 19:36:11 +00:00
Gabor Kovesdan
e9a6792326 - Add Russian catalog [1]
- Fix two minor nits in manpage [2]
- style.Makefile(5)

Submitted by:   pluknet <pluknet at gmail.com> [1],
                Alex Kozlov <spam@rm-rf.kiev.ua> [2]
Reviewed by:    delphij
2010-07-23 17:42:42 +00:00
Gabor Kovesdan
4dc88ebedf Add BSD grep to the base system and make it our default grep.
Deliverables: Small and clean code (1,4 KSLOC vs GNU's 8,5 KSLOC),
              lower memory usage than GNU grep, GNU compatibility,
              BSD license.

TODO:         Performance is somewhat behind GNU grep but it is only
              significant for bigger searches.  The reason is complex, the
              most important factor is that GNU grep uses lots of
              optimizations to improve the speed of the regex library.
              First, we need a modern regex library (practically by adopting
              TRE), add support for GNU-style non-standard regexes and then
              reevalute the performance issues and look for bottlenecks.  In
              the meantime, for those, who need better performance, it is
              possible to build GNU grep by setting WITH_GNU_GREP.

Approved by:            delphij (mentor)
Obtained from:          OpenBSD (http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/grep/),
                        freegrep (http://github.com/howardjp/freegrep)
Sponsored by:           Google SoC 2008
Portbuild tests run by: kris, pav, erwin
Acknowledgements to:    fjoe (as SoC 2008 mentor),
                        everyone who helped in reviewing and testing
2010-07-22 19:11:57 +00:00
Rui Paulo
582a734e13 Build clang libraries by default with -fno-exceptions and with
-fno-rtti. The clang libaries that really use exceptions and virtual
functions can enable LLVM_REQUIRES_EH and LLVM_REQUIRES_RTTI
respectively. This saves space on the resulting binaries and follows
what's being done upstream.

Submitted by:	Dimitry Andric <dimitry at andric.com>
2010-07-22 19:09:34 +00:00
Ed Schouten
ffd1746d03 Upgrade our Clang in base to r108428.
This commit merges the latest LLVM sources from the vendor space. It
also updates the build glue to match the new sources. Clang's version
number is changed to match LLVM's, which means /usr/include/clang/2.0
has been renamed to /usr/include/clang/2.8.

Obtained from:	projects/clangbsd
2010-07-20 17:16:57 +00:00
Alexander Motin
f91b7a2526 Partially revert r209312, restoring ability to fit "stray irqX" names into
into available 10 characters by dropping "irq" in the middle of string.
2010-07-19 02:26:59 +00:00
Tijl Coosemans
857e086b80 - Add myself to committers-src.dot
- Add myself to calendar.freebsd

Approved by:	kib (mentor)
2010-07-17 18:35:39 +00:00
Joseph S. Atkinson
12c5cab23e Nervously welcoming myself to the family.
Add myself to all the appropriate places, upload my pgp key, and announce
my arrival to the FreeBSD world.

Approved by:	wxs@ (mentor)
2010-07-16 18:06:19 +00:00
Ed Maste
5eb2aa4543 Remove more extraneous ;s. 2010-07-15 00:04:14 +00:00
John Baldwin
d4523bd9cb - Sort list of trace points.
- Note that 'y' (sysctl requests) is in the default set of trace points.

MFC after:	3 days
2010-07-14 18:28:46 +00:00
Attilio Rao
837ada2240 Fix spelling.
Sponsored by:	Sandvine Incorporated
Submitted by:	b.f. <bf1783 at googlemail dot com>
MFC after:	2 weeks
X-MFC:		210063
2010-07-14 17:46:44 +00:00
Attilio Rao
1d73ef9790 Fix the way the segments are included in the gcore outputs (with the
default invokation):
- Right now if segments are not writable are not included. Remove this.
- Right now if a segment is mapped with NOCORE the check is not honoured.
  Change this by checking the newly added flag, from libutil,
  KVME_FLAG_NOCOREDUMP.

Besides that, add a new flag (-f) that forces a 'full' dump of all the
segments excluding just the malformed ones. This might be used very
carefully as, among the reported segments, there could be memory
mapped areas that could be vital to program execution.

Sponsored by:	Sandvine Incorporated
Discussed with:	kib
Reviewed by:	emaste
Tested by:	Sandvine Incorporated
MFC after:	2 weeks
2010-07-14 17:16:25 +00:00
Ed Maste
bccf948ea9 Remove extraneous ; 2010-07-12 17:18:58 +00:00
Nathan Whitehorn
e6d0d807bf Teach truss and xlint how to operate on 64-bit PowerPC systems. 2010-07-12 00:54:41 +00:00
Benedict Reuschling
832ccb58f4 Fix an error in the EXAMPLES section of getopt(1), which is based on
the same fix present in NetBSD.

Note: the getopt man page contains more antique information like this.
An overhaul of the man page and/or sync with NetBSD would be the right
thing to do. But since this is out of the scope of the PR, I'll leave
it as it is for now.

PR:             docs/133118
Submitted by:   Oleg A. Mamontov (oleg at mamontov dot net)
Discussed with: jilles@
MFC after:      2 weeks
2010-07-07 17:44:09 +00:00
Gavin Atkinson
31fa41024e Various changes to make locate compilable with WARNS=6. Note that there
is still one issue on FreeBSD/arm (signed vs unsigned char) which prevents
actually bumping this to WARNS=6 - I'm still considering the correct
solution to this issue.

Tested by:		make universe
2010-06-28 12:04:55 +00:00
Gavin Atkinson
ddcdd26ef6 Make WARNS=6 safe, mainly by casting to intmax_t and printing with %ju
where needed.  Also, fix bad indentation on lines already affected by the
above changes.

Tested with:	make universe
2010-06-28 12:00:20 +00:00
Gavin Atkinson
84f70ae360 Make WARNS=6 safe.
Tested by:	make universe
2010-06-28 08:30:10 +00:00
Gavin Atkinson
16596b221d Make the second example command more closely match the demo output, and as
a side effect more clearly show the change in command lines between the
first and second example invocations.
2010-06-27 23:11:35 +00:00
Gavin Atkinson
c54da67276 Fix transfer statistics in the "send file" case - The conditional used
to print the stats were using an uninitialised variable. [1]

Fix trasnfer statistics in the "receive file" case - the statistics struct
was being cleared both before and after the initial connect to the remote
server.  As a result, the printed time and calculated bandwidth covers
the time to connect ad well as the time to transfer the file.  This may
not be ideal, but now at least matches the "send file" case.

Found by:	clang static analyser [1]
Reviewed by:	imp
2010-06-27 14:21:08 +00:00
Gavin Atkinson
a1ec94b88d Fix core dump when server fails to respond.
Reviewed by:	imp
2010-06-27 14:11:03 +00:00
Brian Somers
f0cc075c4f Add a -t switch for masking output that's above or below certain thresholds.
This switch makes it a lot easier to locate problem areas when a process
is threatening to consume all of your disk space.

PR:		144192
Submitted by:	gk
MFC after:	3 weeks
2010-06-20 08:27:03 +00:00
Gavin Atkinson
ae7f9676e7 Variable 'getmap' is unused.
Found by:	clang static analyzer
2010-06-19 16:24:55 +00:00
Alexander Motin
cb9c9783b4 Do not print first digits of IRQ number if whole number doesn't fit. 2010-06-18 18:18:03 +00:00
Gabor Kovesdan
096dbab98c - Update GCC reference from 3.3 to 4.2 [1]
- Add reference to c99(7)

Submitted by:	stefanf
2010-06-17 14:37:47 +00:00
Sean Bruno
bf96595915 Add a new column to the output of vmstat -z to indicate the number
of times the system was forced to sleep when requesting a new allocation.

Expand the debugger hook, db_show_uma, to display these results as well.

This has proven to be very useful in out of memory situations when
it is not known why systems have become sluggish or fail in odd ways.

Reviewed by:	rwatson alc
Approved by:	scottl (mentor) peter
Obtained from:	Yahoo Inc.
2010-06-15 19:28:37 +00:00
Ed Schouten
09071d46ab err() takes a printf format.
Submitted by:	Pawel Worach
Spotted by:	clang
2010-06-15 04:47:16 +00:00
Tim Kientzle
0c1bca0fd2 If the compressed data is larger than the uncompressed,
report the compression ratio as 0% instead of displaying
nonsense triggered by numeric overflow.  This is common
when dealing with uncompressed files when the I/O blocking
causes there to be small transient differences in the
accounting.

Thanks to:  Boris Samorodov
2010-06-14 02:56:45 +00:00
Gavin Atkinson
3583a05a70 These files are no longer required since r207607 2010-06-12 19:32:52 +00:00
Dag-Erling Smørgrav
dd73646c6c Install tblgen so partial / progressive builds are still possible. 2010-06-12 16:04:29 +00:00
Ulrich Spörlein
72f27fcbb1 Use same table markup as in hexdump.1 2010-06-11 06:04:14 +00:00
Xin LI
08b300a1b7 Several style fixes as prompted by bde@.
While I'm there, loosen the st_nlink check and fix grammar for 1 extra
links.
2010-06-10 20:59:28 +00:00
Bjoern A. Zeeb
54e57c8145 Make the char *n_name member of struct nlist 'const'.
This avoids errors or __DECONST() from places with higher WARNS levels.

Adjust a local cache variable in ipcs to const as well
to compile in the new world order.

Suggested by:	jhb
Reviewed by:	jhb, kib, brueffer (man)
2010-06-10 14:19:51 +00:00
Gabor Kovesdan
07f9cfc4ff - Axe out signal handling code, the shell will take care of this
Suggested by:	jilles
Approved by:	delphij (mentor)
2010-06-10 10:28:38 +00:00
Gabor Kovesdan
5349f70253 - Fix style(9)
Submitted by:	ed
Approved by:	delphij (mentor)
2010-06-10 10:17:00 +00:00
Roman Divacky
6513cfc82f Hook clang into the build on i386/amd64/powerpc.
Approved by:	ed (mentor)
2010-06-09 19:57:20 +00:00
Roman Divacky
47c832c3dd Import the build makefiles for clang/LLVM.
Approved by:	ed (mentor)
2010-06-09 19:32:20 +00:00
Xin LI
d994242647 Check return value from archive_read_new().
Found with:	Coverity Prevent(tm)
CID:		8462
Reviewed by:	des
MFC after:	1 week
2010-06-09 18:59:07 +00:00
Edwin Groothuis
0a76c6484c fix memset() calls.
Found with:   Coverity Prevent(tm)
CID:          8531
2010-06-09 10:36:25 +00:00
Xin LI
1371ad1594 Follow up revision 208888 with purely ident changes.
MFC after:	1 week
2010-06-07 10:10:44 +00:00
Xin LI
09e979e915 Correct a bug in gzip(1): make sure that initialize isb with fstat() on
input file before using it.

PR:		bin/147275
Submitted by:	thomas
MFC after:	1 week
2010-06-07 10:09:40 +00:00
Gabor Kovesdan
85bf7ec797 - Fix signal handling in bc/dc. Now Ctrl-C terminates the execution.
Requested by:	gk (via private mail)
Approved by:	delphij (mentor)
2010-06-06 11:36:08 +00:00
Gabor Kovesdan
31dadaf609 - Fig segmentation fault
Submitted by:	Hizel Ildar <hizel@vyborg.ru> (via current@)
2010-06-06 11:32:38 +00:00
Edwin Groothuis
43a7b5c3e1 Make clang happier by removing unused assignments. 2010-06-05 12:31:08 +00:00
Edwin Groothuis
73fd7c1d5d Fix warnings about uninitialized variables.
It was mostly harmless since strftime() only used %a and %b anyway.

Found with:   Coverity Prevent(tm)
CID:          7769
2010-06-05 11:41:46 +00:00
Edwin Groothuis
1962c0ae34 Fix: when unable to parse the sequence string, erase everything.
Found with:   Coverity Prevent(tm)
CID:          7888
2010-06-05 11:32:31 +00:00
Edwin Groothuis
7e63c265da Fix memory-leak at the processing of multiple calendars.
Found with:   Coverity Prevent(tm)
CID:          7085
2010-06-05 11:12:35 +00:00
Edwin Groothuis
78c6c39d48 Properly check the return value of chdir, even if it is a "this
should not happen" case.

Found with:   Coverity Prevent(tm)
CID:          4932
2010-06-05 11:06:56 +00:00
Matthew D Fleming
5e25430c4e - Add myself to committers-src.dot
- Add myself to calendar.freebsd

Approved by:	zml (mentor)
2010-06-04 17:54:30 +00:00
Andrey V. Elsukov
28c0f4ec05 - Add myself to committers-src.dot
- Add myself to calendar.freebsd

Approved by:	kib (mentor)
2010-06-03 21:12:51 +00:00
Ulrich Spörlein
e10c1be450 mdoc cleanup
Garbage collect unused sections, macros and arguments. Fix prologue and
remove empty lines.

Found by: mdocml
2010-06-02 10:20:23 +00:00
Brian Somers
9c24af3d15 Fix stuttering sequences and reverse ranges
PR:		123635
Submitted by:	Ulrich Spörlein, uqs at spoerlein dot net
2010-06-02 07:47:29 +00:00
Ulrich Spörlein
a1d170a0b6 mail(1) misses addresses when replying to all
There's a parsing error for fields where addresses are not separated by
space. This is often produced by MS Outlook, eg.:
Cc: <foo@bar.com>,"Mr Foo" <foo@baz.com>

The following line now splits into the right tokens:
Cc: f@b.com,z@y.de, <a@a.de>,<c@c.de>, "foo" <foo>,"bar" <bar>

PR:		bin/131861
Submitted by:	Pete French <petefrench at ticketswitch.com>
Tested by:	Pete French
Reviewed by:	mikeh
MFC after:	2 weeks
2010-05-27 12:59:49 +00:00
Sean Bruno
8b10473d30 Allow sub-second interval timings for iostat and vmstat.
e.g.
vmstat -w.5
iostat -w.5

Reviewed by:	jhb
Approved by:	scottl (mentor)
Obtained from:	Yahoo Inc.
MFC after:	2 weeks
2010-05-21 17:10:52 +00:00
Sergey A. Osokin
10a669dfe5 Add new memory days for Russian Federation.
Fix date and description.

Obtained from:	http://pda.lenta.ru/news/2010/05/19/baptism/
		http://www.garant.ru/doc/busref/spr_prazdn/

Thanks to:	maxim
2010-05-20 10:51:22 +00:00
Jung-uk Kim
07e547fe26 Add a new build option, MAN_UTILS. This option lets you control building
utilities and related support files for manual pages, which were previously
controlled by MAN.  For POLA, the default depends on MAN, i.e., WITHOUT_MAN
implies WITHOUT_MAN_UTILS and WITH_MAN implies WITH_MAN_UTILS.  This patch
is slightly improved by me from:

PR:		misc/145212
2010-05-19 23:56:26 +00:00
Ulrich Spörlein
62486687ed mdoc: consistently spell our email addresses <foo@FreeBSD.org>
Reviewed by:	ru
2010-05-19 08:57:53 +00:00
Pawel Jakub Dawidek
c9a9640635 Use better type for siginfo (volatile sig_atomic_t instead of int).
Pointed out by:	jh
2010-05-17 19:13:49 +00:00
Kai Wang
5dfab45b42 Removed ar(1)'s support for compressed archives. This change removes
ar(1)'s dependencies on compressor libraries -lz, -lbz2 and -llzma and
fixes building HEAD on some versions of FreeBSD[78]. Option -j and -z
is now accepted but ignored.

Compressed ar(1) archives are not useful without a ld(1) that can read
them. Also, the current ar(1) compression scheme prevents random
access of archive members and needs to be redesigned anyway.

Submitted by:	kientzle (original patch)
Reviewed by:	delphij
Discussed on:	-current mailing list
2010-05-17 09:37:59 +00:00
Pawel Jakub Dawidek
f09bc09332 On SIGINFO print current values on stderr. 2010-05-16 21:06:26 +00:00
Doug Barton
eedb7f6041 Remove duplicate 2010-05-14 19:14:59 +00:00
Ulrich Spörlein
0b31f1f731 mdoc: move remaining sections into consistent order
This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:08:11 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Christian Brueffer
346bfbfcce - Missing full stops
- Upper case the first character of an description
- Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81
- Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61
- s/seperating/separating/

PR:		135165
Submitted by:	Alan R. S. Bueno <alan.bsd@gmail.com>
MFC after:	1 week
2010-05-12 02:00:11 +00:00
Ulrich Spörlein
cccbcac6bb mdoc: remove stray and
Found via:	mdocml
Reviewed by:	brueffer
2010-05-11 23:08:22 +00:00
Martin Matuska
7fbeb03eb7 Enable liblzma support in libarchive
Adjust dependencies for programs using libarchive
Add xz and linkage against liblzma to rescue system

Approved by:	kientzle, delphij (mentor)
MFC after:	2 weeks
2010-05-10 15:28:44 +00:00
Martin Matuska
98be819983 Add two public headers missing in r207842
Adjust CFLAGS for lzmainfo, xz, xzdec

Approved by:	delphij (mentor)
MFC after:	2 weeks
2010-05-10 07:47:31 +00:00
Martin Matuska
81ad83880d Import of liblzma, xz, xzdec, lzmainfo from vendor branch
Add support for xz and lzma to lesspipe.sh (xzless, lzless)
Bump __FreeBSD_version

Approved by:	delphij (mentor)
MFC after:	2 weeks
2010-05-10 06:59:50 +00:00
Tim Kientzle
b6cb607644 bsdcpio 2.8.3 2010-05-08 16:47:33 +00:00
Tim Kientzle
9122b590b2 FreeBSD is now using bsdtar 2.8.3. 2010-05-08 16:29:02 +00:00
Tim Kientzle
9b9439b486 Config updates. 2010-05-08 16:28:22 +00:00
Tim Kientzle
35e68db373 Various manpage updates, including many long-option synonyms that were previously undocumented. 2010-05-08 15:43:59 +00:00
Kirk McKusick
e27ed89aef Merger of the quota64 project into head.
This joint work of Dag-Erling Smørgrav and myself updates the
FFS quota system to support both traditional 32-bit and new 64-bit
quotas (for those of you who want to put 2+Tb quotas on your users).

By default quotas are not compiled into the kernel. To include them
in your kernel configuration you need to specify:

options         QUOTA                   # Enable FFS quotas

If you are already running with the current 32-bit quotas, they
should continue to work just as they have in the past. If you
wish to convert to using 64-bit quotas, use `quotacheck -c 64';
if you wish to revert from 64-bit quotas back to 32-bit quotas,
use `quotacheck -c 32'.

There is a new library of functions to simplify the use of the
quota system, do `man quotafile' for details. If your application
is currently using the quotactl(2), it is highly recommended that
you convert your application to use the quotafile interface.
Note that existing binaries will continue to work.

Special thanks to John Kozubik of rsync.net for getting me
interested in pursuing 64-bit quota support and for funding
part of my development time on this project.
2010-05-07 00:41:12 +00:00
Jilles Tjoelker
c84cab5626 Update xrefs from 4.3BSD to modern signal functions in various man pages.
sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and
sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2).

Some legacy man pages still refer to them, that is OK.
2010-05-06 22:49:54 +00:00
Xin LI
3f65dafda3 Plug a memory leak.
MFC after:	2 weeks
2010-05-06 21:57:38 +00:00
Kirk McKusick
945f418ab8 Final update to current version of head in preparation for reintegration. 2010-05-06 17:37:23 +00:00
Xin LI
3549ef2f2b Revert r207677 which is considered a violation of style(9).
Pointed out by:	bde
Pointy hat to:	delphij
2010-05-06 17:06:36 +00:00
Andrey A. Chernov
e86a8937dc While I am here, add more missing (unsigned char) casts to ctype() macros 2010-05-06 16:54:46 +00:00
Andrey A. Chernov
b277fb56f9 Fix recent space skipping:
1) add missing (unsigned char) cast to ctype() macro
2) fix off-by-one error causing last letter always doubled
2010-05-06 16:37:50 +00:00
Xin LI
d18129ea1d Move SCCS tags to comments as they were already #if 0'ed. 2010-05-05 21:24:18 +00:00
Warner Losh
a3255f9b15 Doh! Add another new file forgotten by the importer of edwin@'s tftp
improvements.

MFC after:	1 week
Pointy Hat: imp-o-rama...
2010-05-04 17:00:18 +00:00
Ed Maste
11666ce50a Restore historical behaviour of only executing chflags on files that exist.
This eliminates cosmetic errors of the form "chflags: ...: No such file or
directory" during an installworld to an empty destination.
2010-05-04 11:34:13 +00:00
Warner Losh
752fa69402 Go ahead and merge the work edwin@ on tftpd into the tree. It is a
lot better than what's in the tree now.  Edwin tested it at a prior
employer, but can't test it today.  I've found that it works a lot
better with the various uboot versions that I've used in my embedded
work.  Here's the pkg-descr from the port that describes the changes:

It all started when we got some new routers, which told me the
following when trying to upload configuration or download images
from it: The TFTP server doesn't support the blocksize option.

My curiousity was triggered, it took me some reading of RFCs and
other documentation to find out what was possible and what could
be done. Was plain TFTP very simple in its handshake, TFTP with
options was kind of messy because of its backwards capability: The
first packet returned could either be an acknowledgement of options,
or the first data packet.

Going through the source code of src/libexec/tftpd and going through
the code of src/usr.bin/tftp showed that there was a lot of duplicate
code, and the addition of options would only increase the amount
of duplicate code. After all, both the client and the server can
act as a sender and receiver.

At the end, it ended up with a nearly complete rewrite of the tftp
client and server. It has been tested against the following TFTP
clients and servers:

- Itself (yay!)
- The standard FreeBSD tftp client and server
- The Fedora Core 6 tftp client and server
- Cisco router tftp client
- Extreme Networks tftp client

It supports the following RFCs:

RFC1350 - THE TFTP PROTOCOL (REVISION 2)
RFC2347 - TFTP Option Extension
RFC2348 - TFTP Blocksize Option
RFC2349 - TFTP Timeout Interval and Transfer Size Options
RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability
          Statement for the Trivial File Transfer Protocol (TFTP)

It supports the following unofficial TFTP Options as described at
http://www.compuphase.com/tftp.htm:

blksize2 - Block size restricted to powers of 2, excluding protocol headers
rollover - Block counter roll-over (roll back to zero or to one)

From the tftp program point of view the following things are changed:

- New commands: "blocksize", "blocksize2", "rollover" and "options"
- Development features: "debug" and "packetdrop"

If you try this tftp/tftpd implementation, please let me know if
it works (or doesn't work) and against which implementaion so I can
get a list of confirmed working systems.

Author: Edwin Groothuis <edwin@FreeBSD.org>
2010-05-04 06:13:17 +00:00
Jilles Tjoelker
8f3bd46654 pathchk(1): Fix the example so it allows arbitrary pathnames.
Spaces and various other characters in pathnames are not passed through
literally by xargs in its default mode. Instead, use find . -exec ... {} +

Although the -- argument is not strictly required here, add it anyway to
avoid surprises when modifying the code to find -f -somedir ...

MFC after:	1 week
2010-05-01 22:10:45 +00:00
Jilles Tjoelker
da21952559 pathchk: Add the new POSIX -P option.
This option checks for empty pathnames and components starting with '-'.
Our -p option also checks for the latter, which remains the case.

MFC after:	1 week
2010-05-01 22:00:28 +00:00
Ed Schouten
e1e9ba3370 Remove WNOHANG flag from wait3().
Because script(1) now reliably terminates when the TTY is closed, it may
be the case that the call to wait3() occurs just before the child
process exits. This causes error codes to be ignored.

Just change script(1) to use waitpid() instead of wait3(). This makes it
more portable and prevents the need for a loop, since waitpid() only
returns a specified process.

PR:		bin/146189
Tested by:	amdmi3@, older version
MFC after:	2 weeks
2010-04-30 22:33:49 +00:00
Kirk McKusick
a4bf5fb987 Update to current version of head. 2010-04-28 05:33:59 +00:00
Xin LI
637bfa488b Use _exit(2) system call directly instead of using exit(3) in signal
handler, as the latter is not guaranteed to be signal safe, and we
do not really care about flushing the stream during SIGINT.

Suggested by:	Maxim Konovalov <maxim.konovalov gmail com>
MFC after:	13 days
2010-04-27 17:57:04 +00:00
Xin LI
1edd4fcd23 Language improvements to make the BUGS section easier to read.
Reviewed by:	Alexander Best <alexbestms wwu de>
MFC after:	13 days
2010-04-27 17:50:43 +00:00
Xin LI
18333f544e Add a signal handler for SIGINT which removes output file when necessary.
While I'm there, move unlink_input() slightly down to after closing the
output file, in uncompression path.

MFC after:	2 weeks
2010-04-26 20:05:48 +00:00
Jilles Tjoelker
36f8c7ebef Make hash, type and ulimit available via execve().
These are specified by POSIX but are not special builtins, and therefore
need to be available via execve() and utilities like time, nohup, xargs.
(Note that hash was moved from the XSI option to the base in the 2008
standard.)

Like most of the POSIX "regular builtin commands", these need to be executed
in a shell environment for full functionality, although they may still be of
some use outside one.

Unlike the POSIX special and regular builtin commands, POSIX does not
require these to be found before a PATH search, although that could be an
oversight.

Like some of the utilities already provided by usr.bin/alias, these may lead
to confusing results when invoked from csh(1).
2010-04-25 17:38:53 +00:00
Jilles Tjoelker
24d9be57ae stat: Allow -f %Sf to display the file flags symbolically.
I have changed the patch slightly to show '-' if there are no flags just
like ls -ldo does.

PR:		124349
Submitted by:	Ighighi
MFC after:	1 week
2010-04-24 13:53:12 +00:00