Commit Graph

8627 Commits

Author SHA1 Message Date
brian
66da1b8b10 Fix a typo 2007-04-03 19:14:39 +00:00
chinsan
ce5c98a7c9 - Add myself.
Approved by:	delphij@ (mentor)
2007-04-03 06:02:49 +00:00
yar
d1f2d71a20 Don't forget to close the range if we branched over its end
and had no chance to match it by the 2nd address precisely.
Otherwise the unclosed range would bogusly extend to the end
of stream.

Add a basic regression test for the bug fixed.  (This change
also fixes the more complex case 5.3 from `multitest.t'.)

Compared with:	SUN and GNU seds
Tested by:	regression tests
MFC after:	1 week
2007-04-02 08:14:46 +00:00
yar
50830d7bd9 Prevent foot-shooting in advance: Put the MATCH() macro's value
in parentheses.  The ?: operator has a remarkably low precedence, so
expressions like (MATCH(foo) && bar) would have an unexpected meaning
w/o the parentheses around MATCH().

Tested with:	md5(1)
2007-04-02 06:47:48 +00:00
yar
4a558e4ff5 This trivial change should fix at least 3 similar bugs. All of
them are related to the `c' function's need to know if we are at
the actual end of the address range.  (It must print the text not
earlier than the whole pattern space was deleted.)  It appears the
only sed function with this requirement.

There is `lastaddr' set by applies(), which is to notify the `c'
function, but it can't always help because it's false when we are
hitting the end of file early.  There is also a bug in applies()
due to which `lastaddr' isn't set to true on degenerate ranges such
as `$,$' or `N,$' if N appears the last line number.

Handling early EOF condition in applies() could look more logical,
but it would effectively revert sed to the unreasonable behaviour
rev. 1.26 of main.c fought against, as it would require lastline()
be called for each line within each address range.  So it's better
to call lastline() only if needed by the `c' function.

Together with this change to sed go regression tests for the bugs
fixed (c1-c3).  A basic test of `c' (c0) is also added as it helped
me to spot my own error.

Discussed with:		dds
Tested by:		the regression tests
MFC after:		1 week
2007-04-01 13:25:03 +00:00
cperciva
1720c4fbcb Add tests for "bsdtar -t". These are useful primarily because they test
the archive_read_data_skip code.
2007-03-31 22:04:36 +00:00
cperciva
04b5ff28d3 Split the append_archive function (used for processing @<archive> directives)
into separate append_archive and append_archive_filename functions; the first
takes a "struct archive *" as input, while the second takes a filename, opens
the archive, and calls the first.

There should be no changes in behaviour as a result of this commit; it simply
reorganizes code to make more sense.  At some point in the future it may be
possible to share code between append_archive and read_archive, but not yet.

Discussed with:	kientzle
2007-03-31 10:14:03 +00:00
yar
307e4679c3 Make the comment for cspace() match reality. 2007-03-31 09:08:22 +00:00
delphij
37cce1fb37 Update for bzip2 1.0.4 import. 2007-03-28 07:48:03 +00:00
maxim
f608810850 o Really commit typo fixes to HEAD.
PR:		docs/110809
Submitted by:	naddy
2007-03-25 18:37:59 +00:00
kientzle
4fa4b823d2 Issue a warning if there's a non-zero exit value. 2007-03-24 03:25:49 +00:00
jkim
a5ad971145 Add '-s' option and update the manual page. With this option, it prints
little more style(9) friendly output.  For example:

%file2c -n 8 -s -x 'const char data[] = {' '};' < /etc/motd
const char data[] = {
	0x46, 0x72, 0x65, 0x65, 0x42, 0x53, 0x44, 0x20,
	0x37, 0x2e, 0x30, 0x2d, 0x43, 0x55, 0x52, 0x52,
	0x45, 0x4e, 0x54, 0x20, 0x28, 0x42, 0x45, 0x41,
	0x53, 0x54, 0x49, 0x45, 0x29, 0x20, 0x23, 0x30,
	0x3a, 0x20, 0x57, 0x65, 0x64, 0x20, 0x4d, 0x61,
	0x72, 0x20, 0x32, 0x31, 0x20, 0x31, 0x39, 0x3a,
	0x30, 0x34, 0x3a, 0x33, 0x36, 0x20, 0x45, 0x44,
	0x54, 0x20, 0x32, 0x30, 0x30, 0x37, 0x0a
};
2007-03-23 00:00:22 +00:00
emaste
77a22ac882 Use proc name (ki_comm) instead of thread name (ki_ocomm) as these may now
be different.
2007-03-22 17:47:58 +00:00
cperciva
aece76cbcd Remove pathlen argument from write_entry function. It has never been used.
Approved by:	kientzle
MFC after:	3 days
2007-03-17 19:18:29 +00:00
cperciva
117ac27300 Fix logic bug; we want to do_chdir if arg doesn't start with / _and_ it
doesn't start with @/ either.

This unbreaks "tar -c -C /no/such/directory @/path/to/archive".

MFC after:	3 days
2007-03-17 16:17:14 +00:00
delphij
9dd2be0d64 Mention a limitation that was inherted from RFC1952, making
it impossible to obtain correct file size from a file that
is larger than 4GB before compression.

PR:		bin/110329
MFC after:	1 week
2007-03-16 03:50:53 +00:00
cperciva
32001bac97 Don't consider an lstat(2) failure to be an error (in the sense of
affecting the return value from bsdtar), since (a) it usually occurs
due to a perfectly innocent (and unavoidable) race condition where a
user deletes a file in the window between bsdtar reading a directory
and attempting to read the file; and (b) aside from printing a warning
message, bsdtar behaves exactly as if the file had been deleted prior
to bsdtar reading its parent directory.

Reviewed by:	kientzle
MFC after:	6 days
2007-03-15 10:11:38 +00:00
dds
940ef56355 Test files repo-copied into tools/regression/usr.bin/sed and integrated
into the regression testing framework.
2007-03-14 13:43:32 +00:00
cperciva
83a1ac8fb2 Reduce the risk of inducing heart attacks, by printing the right path when
complaining about lstat(2) failing.  It's a bit scary to find the message
  tar: /: Cannot stat: No such file or directory
printed while doing a backup.

MFC after:	1 week
2007-03-14 07:30:51 +00:00
kientzle
ab3553dfb4 Clarify the test comments in test-basic.sh. Have config.sh do a
better job searching for the bsdtar binary to test and the gtar binary
to use for inter-operability testing.  It should now find the built
(but not installed) binary if there is one, then search for an
installed binary in a number of standard locations.
2007-03-11 19:33:45 +00:00
kientzle
7cd084865b bsdtar 2.0.23:
* New test scripts exercise some basic functionality
   * Most header inclusions are now protected (portability)
   * read.c now relies on security checks in libarchive instead
     of trying to do its own (optimization)
   * -p now enabled by default for root, add --no-same-permissions
     to disable it
   * Comments, minor style fixes.
2007-03-11 10:36:42 +00:00
bushman
0129b40874 Add myself.
Approved by:	brooks (mentor)
2007-03-11 06:44:37 +00:00
mbr
784667db7c Uppercase FreeBSD, sigh. 2007-03-10 18:31:33 +00:00
mbr
27f0d39f3b Add myself 2007-03-10 18:30:12 +00:00
brueffer
578361cc4b Uppercase FreeBSD. 2007-03-10 12:45:46 +00:00
ru
1499ddfc67 Bump the original revision of c89(1). 2007-03-10 07:11:20 +00:00
ru
4737cf8a81 Reduce diffs with c99(1). 2007-03-10 07:10:01 +00:00
mckusick
6f0e028b09 Add myself. 2007-03-10 05:56:05 +00:00
ru
33cf984c1f Sort (once again) by month/day/year/login. 2007-03-09 20:31:46 +00:00
jkois
28054e68a1 Add my record.
Discussed with and approved by: remko@
2007-03-09 20:14:59 +00:00
emaste
b03e9e93ed KERN_PROC_ALL produces a kinfo_proc for each thread in a process, which
caused fstat to produce duplicated output for threaded processes.  Instead
use KERN_PROC_PROC to get just one kinfo_proc per process.

MFC After:	2 weeks
2007-03-09 16:21:40 +00:00
ru
723794ddf2 Fix markup. 2007-03-09 14:36:18 +00:00
ru
e13673a69c Spell "id" as "ID". 2007-03-09 12:45:00 +00:00
miwi
0db7f2bd93 - Add my birthday 2007-03-08 22:53:50 +00:00
fjoe
f13438e457 Better English. 2007-03-08 14:05:45 +00:00
mita
2b2cf55a08 Following rwatson's suggestion.
<20070307130635.M28276@fledge.watson.org>
2007-03-08 13:09:55 +00:00
tdb
be0a5845fc Add my birthday to the FreeBSD calendar.
Encouraged by:	rwatson
2007-03-08 12:17:01 +00:00
ticso
d9d5725f51 Add myself to the FreeBSD calendar. 2007-03-08 10:54:27 +00:00
fjoe
19d858e266 Implement "Remaking Makefiles" feature:
After reading Makefile and all the files that are included using .include
or .sinclude directives (source Makefiles) make considers each source
Makefile as a target and tries to rebuild it.  Both explicit and implicit
rules are checked and all source Makefiles are updated if necessary. If
any of the source Makefiles were rebuilt, make restarts from clean state.

To prevent infinite loops the following source Makefile targets are
ignored:
- :: targets that have no prerequisites but have commands
- ! targets
- targets that have .PHONY or .EXEC attributes
- targets without prerequisites and without commands

When remaking a source Makefile options -t (touch target), -q (query
mode), and -n (no exec) do not take effect, unless source Makefile is
specified explicitly as a target in make command line.
Additionally, system makefiles and .depend are not considered as a
Makefiles that can be rebuilt.

Reviewed by:	harti
2007-03-08 09:16:11 +00:00
will
f6d48b2630 Fix a bug where the standard input (fifoFd == 0) was confused with an
error return from open(2), leading to an erroneous value of maxJobs and
a hung make when -f is standard input and -j is used.

PR:		bin/101232
Submitted by:	Nate Eldredge <nge@cs.hmc.edu>
2007-03-08 07:57:43 +00:00
kientzle
4f72159a41 Argh. Support for reading ACLs off of disk was inadvertently disabled
as part of an old configuration shuffle.  As a result, although
ACL restore has been working, ACLs haven't been written into archives
for some time.  <sigh>

Pointy hat: You know.
MFC after: 3 days
2007-03-08 05:52:01 +00:00
bmah
53ff49357d Jump on the calendar bandwagon and add myself. 2007-03-07 19:15:18 +00:00
stefan
425f537f26 Add my birthday to calendar.freebsd. 2007-03-07 19:00:01 +00:00
db
e52646418f - Add myself to calendar.freebsd
Encouraged by:	rwatson, ehaupt
Approved by:	ehaupt (mentor)
2007-03-07 16:06:48 +00:00
piso
96e2639962 Correctly sort my entry to FreeBSD calendar first by date, then by year.
Pointed out by: ru
2007-03-07 16:02:32 +00:00
piso
6cd0d56a48 Add my bithdate to the FreeBSD calendar. 2007-03-07 15:08:51 +00:00
ariff
b802e667ee Add my birth date/location to the FreeBSD calendar. 2007-03-07 14:48:42 +00:00
rafan
56cab112ce Add myself to the FreeBSD calendar 2007-03-07 13:45:39 +00:00
kib
e144e70479 Add my birthday to the freebsd calendar 2007-03-07 13:21:55 +00:00
fjoe
b67850e438 Support character device as input file.
PR:             103500
2007-03-06 17:04:15 +00:00
ru
4ce9fbe6ff More markup fixes. 2007-03-04 08:24:13 +00:00
ru
29b8f2f298 Markup fixes. 2007-03-04 08:14:26 +00:00
kientzle
fc9e336ec5 Make the file tests robust against broken symlinks and other
sources of stat()/lstat() failure.
2007-03-03 07:49:08 +00:00
avatar
2d1909f3b9 Fixing NO_INET6 build as addr2ascii() has been nuked in previous commit. 2007-03-02 05:23:39 +00:00
bms
a843fe0d34 stub call to addr2ascii().
Noticed by:	brooks
2007-03-01 02:11:57 +00:00
bms
0738a9d791 Nuke ascii2addr() and addr2ascii(). They have no consumers anywhere
in FreeBSD, and originated from INRIA IPv6.

Stub out netstat reference to addr2ascii() I mistakenly introduced.
Update misleading man page sections.

Merge NetBSD's getnameinfo() AF_LINK extensions for a portable way to
print link-layer addresses given a sockaddr_dl(), minus the IEEE 1394
bits which don't map directly to our code.

Obtained from:	NetBSD (getnameinfo.c)
Discussed on:	current (March 2006)
2007-02-28 21:18:38 +00:00
ru
9acb0d3dfd Backport markup fixes from a translated version of a manpage. 2007-02-28 10:22:19 +00:00
ru
c90cdbb3fe Check in some insignificant fixes obtained as a result of
the translation work.
2007-02-28 10:19:25 +00:00
ru
8aed240a3b - Adopt the short description from POSIX as it better matches the
utility name.

- Fix a bug in description: the range preceded by a dash selects
  up to the last number, not first.
2007-02-28 10:13:32 +00:00
ru
b7c805f132 Fix markup. 2007-02-27 12:06:02 +00:00
bde
a94865a5ec Fixed some style bugs (whitespace lossage for removal of __P(()), and
lots of naming and typing errors involving `interval').
2007-02-27 05:10:36 +00:00
bde
3ee0d09a44 Use a periodic itimer instead of repeated calls to alarm() in
sidewaysintpr().  This increases the accuracy of the per-interval
counts when they are interpreted as rates.  Repeated calls to alarm(n)
give an average interval that is about 2 ticks larger than n and has
a large variance.  Periodic itimers normally get the average almost
right but have similarly large variance (due to scheduling delays).

Statistics utilities should use clock_gettime() to determine the
actual interval, but it is still useful to maximize the accuracy of
the interval, especially for cases like netstat -w where counts are
displayed so the program cannot hide the inaccuracy in a rate
conversion.
2007-02-27 04:54:33 +00:00
mohans
384aeb29f6 Reap FIN_WAIT_2 connections marked SOCANTRCVMORE faster. This mitigate
potential issues where the peer does not close, potentially leaving
thousands of connections in FIN_WAIT_2. This is controlled by a new sysctl
fast_finwait2_recycle, which is disabled by default.

Reviewed by: gnn, silby.
2007-02-26 22:25:21 +00:00
jkim
2bd7382fdc Add three new ioctl(2) commands for bpf(4).
- BIOCGDIRECTION and BIOCSDIRECTION get or set the setting determining
whether incoming, outgoing, or all packets on the interface should be
returned by BPF.  Set to BPF_D_IN to see only incoming packets on the
interface.  Set to BPF_D_INOUT to see packets originating locally and
remotely on the interface.  Set to BPF_D_OUT to see only outgoing
packets on the interface.  This setting is initialized to BPF_D_INOUT
by default.  BIOCGSEESENT and BIOCSSEESENT are obsoleted by these but
kept for backward compatibility.

- BIOCFEEDBACK sets packet feedback mode.  This allows injected packets
to be fed back as input to the interface when output via the interface is
successful.  When BPF_D_INOUT direction is set, injected outgoing packet
is not returned by BPF to avoid duplication.  This flag is initialized to
zero by default.

Note that libpcap has been modified to support BPF_D_OUT direction for
pcap_setdirection(3) and PCAP_D_OUT direction is functional now.

Reviewed by:	rwatson
2007-02-26 22:24:14 +00:00
grog
2812c02b77 Add support for selecting from multiple tuners.
Suggested by:	usleepless <usleepless@gmail.com>
2007-02-25 01:28:37 +00:00
grog
75775b9c23 Tidy up forrmat. No functional changes. 2007-02-25 01:08:17 +00:00
bms
79da54db62 Use sysctl(2), not kvm(3), to read IPv6 multicast information from
the running system.
Use the name 'IPv6 Forwarding Table', not 'IPv6 Routing Table', to be
consistent with what the code actually does and is.
2007-02-24 21:58:30 +00:00
bms
03b57a9ea6 Use the names 'IPv4' and 'Forwarding Table' in program output, not
'Routing Table', to be consistent with what the code actually does and is.
2007-02-24 21:56:52 +00:00
bms
e7c3371071 Add comments about where netstat is using KVM to read things which
should really be available via sysctl for a running system.
2007-02-24 21:42:21 +00:00
jls
888dd25b3f Make cu/tip handle when $HOME is not set in the environment.
Approved by: philip
Submitted by: ale
PR: bin/108775
2007-02-23 18:41:12 +00:00
bms
b9c5bc7e70 Update host-mode multicast group information output.
Display IPv4 and IPv6 memberships separately.
  Obey the MK_INET6_SUPPORT flag.
 Display link-layer memberships.
  Use addr2ascii() to correctly print non-IEEE 802 sockaddr_dl instances.
 Eliminate redundant switch..case blocks.
 Update copyright.
 Misc style changes.

MFC after:	3 weeks
2007-02-21 13:59:21 +00:00
bms
37b367b5c8 Change wording of warnings when there is no ip_mroute.ko module
loaded into the system.
Change wording of comments to reflect the fact we should unconditionally
use KVM if the -M option is used to specify a core file.
Add comments to document the fact that IPv6 multicast forwarding
information display still relies on KVM for gathering information.
2007-02-21 13:41:51 +00:00
kientzle
704cfee6a8 If we already have stat() data, we might be able to
determine if this is a physical dir without an lstat().
While I'm in here, try to clarify the comments around
the _is_dir() and _is_physical_dir() tests.
2007-02-21 05:07:43 +00:00
kientzle
f9b1e90cfb Andrew and Colin each pointed out to me that truncating the backup
of a growing file should not be considered a "bad thing."

PR: bin/108990
MFC after: 7 days
Pointy hat: /me
2007-02-18 06:23:57 +00:00
bms
8e211e654f Retire most of the classful network behaviour of netstat -r output, for IPv4.
Without -n, we now only print a "network name" without the prefix length
 under the following conditions:
  1) the network address and mask matches a classful network prefix;
  2) getnetbyaddr(3) returns a network name for this network address.

 With -n, we unconditionally print the full unabbreviated CIDR network
 prefix in the form "a.b.c.d/p". 0.0.0.0/0 is still printed as "default".

This change is in preparation for changes such as equal-cost multipath, and
to more generally assist operational deployment of FreeBSD as a modern IPv4
router. There are currently no plans to backport this change.

Discussed on:	freebsd-net
2007-02-14 14:17:01 +00:00
kientzle
3cdd817959 Correctly handle writes beyond the end of the archive entry
(as determined by the initial size given to the header).
Libarchive recently changed to correctly return the amount
of data actually consumed in this case, which revealed this
bug in bsdtar.
2007-02-14 08:16:08 +00:00
mpp
1e089266fc Allow the -c -f file options to actually execute. 2007-02-13 00:22:29 +00:00
mpp
72c5f98ef8 Fix some spelling / markup / grammar.
Pointed out by: ru
2007-02-11 18:13:00 +00:00
mpp
723a1e7b01 Add two new options to quota:
-f path
    Only print quota information for the file system that path resides on.
-r
    Display the quota information in a raw format.

Reviewed by:	freebsd-hackers
2007-02-11 16:25:25 +00:00
simon
47a4a62547 Do not install zgrep, or links to zgrep, since zgrep is provided by
src/gnu/usr.bin/grep.

Reviewed by:	delphij
2007-02-10 13:49:39 +00:00
kientzle
64e5ae3e30 Update -r handling:
* Create file if it doesn't exist.
  * If archive is "empty", then append to it with pax restricted
  * If user specified a format, use that if it's compatible with
    the existing format.
2007-02-08 07:25:53 +00:00
kevlo
5a57d3e796 getopt(3) returns -1, not EOF. 2007-02-06 08:48:28 +00:00
kevlo
cf67f3127e getopt(3) returns -1, not EOF when out of args. 2007-02-05 07:35:23 +00:00
rse
8ddc79378f cleanup code: remove superfluous comma at end of enumeration
declaration, remove useless "break" after exit(3) call, and add a
missing va_end(3) call.
2007-02-04 20:52:57 +00:00
rse
883431dd45 cleanup code: remove unnecessary and useless void cast
from void-function skip_string().
2007-02-04 20:07:07 +00:00
rse
eccd2b26c0 Correct parser by using intended C equality ("==") instead of
assignment ("=") operator.
2007-02-04 20:06:10 +00:00
rse
768e33c7bc fix bug: avoid dereferencing content of an already free(3)'ed chunk 2007-02-04 20:04:29 +00:00
mpp
42624a547d If a user is over both the soft block limit and soft i-node
limit, quota will report one of the grace times incorrectly.
This is due to it storing the result in a static buffer, and the
routine being called like:
	printf("....", ..., timeprnt(btime), timeprnt(itime), ...)

The problem becomes very obvious if you change one of the default
grace periods to be much larger than the other one.

Changed timeprnt to dynamically allocate the string to be displayed.
2007-02-04 14:06:58 +00:00
mpp
2088a69616 If two files systems, /a and /b are marked as having quotas enabled
in fstab and they are normally mounted as /a/b, if /b is not mounted,
the various quota utilities will incorrectly operate with the quotas on
/a (silently) when operations are attemted on /b.

Sync up all the hasquota() routines between all the different
quota utilities and change it to detect if the file system we are
attempting to perform quota operations on is not currently mounted
and warn the user accordingly.

PR:	bin/38918
2007-02-04 06:33:15 +00:00
mpp
cf5388cd32 Make quota exit with a non-zero status if one more more file
systems are over quota, as documented in the man page.

PR:	bin/77918
2007-02-01 08:37:44 +00:00
delphij
2f4ffd4b4f Fix typo.
Obtained from:	DragonFly
2007-01-31 07:13:25 +00:00
delphij
2089860135 Replace the GNU gzip with a slightly modified NetBSD gzip. The
NetBSD version is a feature-to-feature re-implementation of GNU
gzip using the freely-redistributable zlib and this version is
expected to be mostly bug-to-bug compatible with the GNU
implementation.

 - Because this is a piece of mature code and we want to make
   changes so it is added directly rather than importing to
   src/contrib.
 - Connect newly added code to src/usr.bin/ and rescue/rescue
   build.
 - Disconnect the GNU gzip code from build for now, they will
   be eventually removed completely.
 - Provide two new src.conf(5) knobs, WITHOUT_BZIP2_SUPPORT and
   WITHOUT_BZIP2.

Tested by:	kris (full exp-7 pointyhat build)
Approved by:	core (importing a 4-clause BSD licensed file)
Approved by:	re (adding new utility during -HEAD code slush)
2007-01-26 10:19:08 +00:00
peter
c0fbbdd9e4 Bah. Kris says the default-to-a.out knowledge has migrated into the
official gnu configure scripts and a couple of other places.

Add an example noisy, loud and annoying placeholder for /usr/bin/objformat
if it turns out to too much trouble to be gone.  It is not connected to
the build yet.
2007-01-25 23:12:19 +00:00
peter
1f17881ec3 Retire objformat(1) as threatened in 2002.
Laughed-at-by:  kris
2007-01-25 22:26:41 +00:00
emax
a11c42b474 Add "server mode" to rfcomm_sppd(1).
Submitted by:	Dave Eckhardt, bms
Tested by:	Dave Eckhardt, Eric Anderson, bms
2007-01-25 20:54:59 +00:00
dougb
802f16fd6b Update birth entry for Warren Zevon with his birthplace, and add an
entry for his death. Both per Wikipedia.
2007-01-24 21:21:38 +00:00
maxim
202535955d o Remove duplicate includes.
Obtained from:	Slava Semushin via NetBSD
2007-01-20 08:24:02 +00:00
phk
53becc06fe Make DK-HOSTMASTER show contact info for .dk domains.
Submitted by:	Søren Hansen <shan@soeren-hansen.dk>
2007-01-19 08:13:17 +00:00
ru
a1f44261d4 Fix definitions of kilobits etc.
PR:		bin/106116
Nudged by:	Rostislav Krasny
MFC after:	3 days
2007-01-18 09:24:08 +00:00
keramida
92bee7e5d8 Document that uniq(1) limits input line length to LINE_MAX characters.
PR:		docs/107578
Submitted by:	Jan Schaumann, jschauma.at.netmeister.org
MFC after:	3 days
2007-01-15 23:25:51 +00:00
ru
0a43010407 Tidy up formatting and some wording. 2007-01-15 15:25:15 +00:00
dwmalone
6e5300acbc Updated calendar.judaic from Josef Grosch. I converted some tabs to spaces
before committing this.
2007-01-14 09:58:39 +00:00
brooks
b069330b5d Fix build on architectures where off_t is signed by casting to uintmax_t
before comparing with a size_t.
2007-01-11 20:23:01 +00:00
brooks
fa97295521 Fix head -c ### where ### is greater than 2^31. Unlike the submitted
patch this uses off_t.

WARNSify and add $FreeBSD$ to Makefile.

PR:		bin/107824
Submitted by:	Brian Cornell <briancornell at earthlink dot net>
MFC after:	3 days
2007-01-11 17:03:51 +00:00
jhb
6952dd3772 Add various utrace's for use with ktrace to the ELF runtime linker. To
activate the traces, set the LD_UTRACE (or LD_32_UTRACE) environment
variable.  This also includes code in kdump(8) to parse the traces.

Reviewed by:	kan, jdp
MFC after:	2 weeks
2007-01-09 17:50:05 +00:00
bland
d574c9f05b Update for japanese holidays.
PR:	107703
2007-01-09 08:22:57 +00:00
kientzle
72f9822584 Correct the copyright messages: Make this a standard vanilla
2-clause BSD license, update the year to 2007.
2007-01-09 08:12:17 +00:00
jhb
2381a2638d Add code to parse the utrace(2) entries generated by malloc(3) in a more
human-readable format.  Note that we report 'realloc(p, 0)' as 'free(p)'
since both cases are encoded the same way and 'free()' is more common
than a realloc() to 0.

MFC after:	1 week
2007-01-05 21:04:37 +00:00
cperciva
c3c6135446 If append_archive fails while writing an archive header, output the error
message from the archive being written (not the message from the archive
being read, where no error has occurred).

MFC after:	3 days
2007-01-05 16:20:21 +00:00
rodrigc
e6806e98ac Add sockipprotoname() function. Decode the third parameter (protocol)
of a socket() call with sockipprotoname() if the first parameter (domain)
is PF_INET or PF_INET6.

Old parsing behavior before this change:
ping6    CALL  socket(PF_INET6,SOCK_RAW,0x3a)

New behavior after this change:
ping6    CALL  socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6)
2007-01-04 04:46:59 +00:00
rodrigc
16a5e10cc2 Generate sockdomainname() function with auto_if_type() instead
of auto_or_type.

The old parsing code would incorrectly decode a socket() call in the
ping6 program as:
  CALL  socket(PF_PUP|PF_ECMA|PF_APPLETALK|PF_COIP|PF_SIP,SOCK_DGRAM,0)

The new parsing code decodes the same socket() call as:
  CALL  socket(PF_INET6,SOCK_DGRAM,0)
2007-01-04 04:28:17 +00:00
rodrigc
d665dfeb8c Add auto_if_type() function, which is similar to auto_switch_type().
However, auto_if_type() uses if/else statements in C instead
of a single switch statement, when mapping an integer value to
a #define.  For certain cases where multiple #define constants
alias to a single integer value, auto_if_type() makes things easier
to parse than auto_switch_type().
2007-01-04 04:18:03 +00:00
cperciva
d6c46f500a Clean up the struct archive used for reading an archive in the handling
of @archive commands.  This bug should be harmless as long as you don't
use an excessive number of @archive commands.

MFC after:	1 week
2007-01-02 15:03:38 +00:00
cperciva
1ff610fa56 Handle errors which occur during archive_write_data and archive_write_close
by printing an error message and exiting with a non-zero status code.

MFC after:	1 week
2007-01-02 12:24:14 +00:00
maxim
a83c0deacb o Grammar: is appears -> appears.
PR:		docs/107306
Submitted by:	Tomas Mozes
MFC after:	1 week
2006-12-31 07:22:55 +00:00
yar
070982755d Fix a group of typos:
preceed -> precede,
preceeded -> preceded,
preceeding -> preceding.

Submitted by:	Andre Guibert de Bruet <andy@siliconlandmark.com>
2006-12-29 13:08:46 +00:00
stefanf
c383932a73 Fix SUSv3 compliance: Use a single comma instead of comma and space to separate
additional group entries.

PR:		107298
Submitted by:	Joost Bekkers
2006-12-29 12:28:34 +00:00
ru
40e282c02e Fix tab lossage. 2006-12-29 06:44:24 +00:00
ru
f76541b109 Remove extraneous whitespace. 2006-12-29 06:39:35 +00:00
ru
58c89c331b The Christmas holidays were not showing up due to missing <tab>. 2006-12-29 06:36:32 +00:00
ru
637e022f2e Fix markup nit. 2006-12-28 10:58:06 +00:00
ru
36bb745cb0 Fix markup. 2006-12-28 04:58:38 +00:00
ru
03269f3b4c - Remove the ambiguity in the input format description.
- Fix markup while here.
2006-12-27 14:56:18 +00:00
ru
11227519c9 Simplify. 2006-12-26 12:43:12 +00:00
dryice
381637b19f Add my birthday to calendar.freebsd
Approved by:	itetcu (mentor)
2006-12-26 11:33:26 +00:00
ru
da99f4b113 Say "utility", not "function". 2006-12-26 10:37:37 +00:00
ru
daaaed022c Fix markup. 2006-12-25 20:30:10 +00:00
ru
30b466801f Markup nits. 2006-12-24 19:55:38 +00:00
ru
94d62091c1 Markup revision. 2006-12-24 19:18:52 +00:00
ru
aa4e867828 Document the -d option. 2006-12-24 14:23:35 +00:00
ru
e806adde15 Fix markup. 2006-12-24 13:58:17 +00:00
yar
ed3e8ace9a Add missing things: a prototype and a const qualifier.
Found by:	WARNS=4
2006-12-23 22:39:38 +00:00
ru
46c72e9240 Nits. 2006-12-23 19:15:39 +00:00
yar
2114dc5cdf Dynamically resize the Disk column. It was too narrow for modern
disk device names such as da0s1b.  So we also get rid of the nasty
constant 5 scattered over the code.

Implementing this change is a good chance to improve other bits
around it: init saved lengths early, always check return value from
kvm_getswapinfo().
2006-12-23 18:54:49 +00:00
yar
f3b0f3c65d Clear to EOL after the end of meter so that its reading can decrease. 2006-12-23 18:03:10 +00:00
yar
9729f09883 Make it possible for meter to reach 100% mark when swap is totally full. 2006-12-23 17:46:32 +00:00
ru
05d1f24e02 Improve markup. 2006-12-23 17:14:01 +00:00
yar
f5202f68c1 Improve style:
- Don't define vars inside loops.
- Avoid useless casts.
- Use C idioms.
- Do alike things in a consistent way.
2006-12-23 17:02:09 +00:00
yar
aa4002fd1a Reposition the "(swap not configured)" sign WRT the new layout. 2006-12-23 16:48:29 +00:00
yar
d6cce3632f Eliminate a couple of screen coordinate variables
that were useless and just obfuscated the code.
2006-12-23 16:39:09 +00:00
yar
ca20d95084 Add some vertical whitespace for easier reading. 2006-12-23 16:31:06 +00:00
yar
f396e814f6 Fix the swap display further:
1) Resize the Used column to avoid screen overflow if BLOCKSIZE is long.
2) Track the current swap configuration so that its changes don't break
   the display.

Suggested by:	bde (1)
2006-12-23 15:40:41 +00:00
yar
c5ff9fb420 Fix the Total line shown if there are >1 swap devices. 2006-12-23 14:30:50 +00:00
yar
9da26b3a81 Start fixing the "swap" display by saving one horizontal position.
Now the display won't overflow the 80-char row if BLOCKSIZE=1024.
The new spacing is also consistent with the "pigs" display.
2006-12-23 14:25:17 +00:00
cperciva
3b2e9eb59b Fic typo in previous commit.
MFC after:	3 days
2006-12-23 08:16:54 +00:00
cperciva
b13aff146b Add two checks for inappropriate options: -U only makes sense in "x"
mode, and --strip-components only makes sense in "x" and "t" modes.

MFC after:	3 days
2006-12-23 07:06:37 +00:00
cperciva
a5fb73ad66 Correct the names of some options.
MFC after:	3 days
2006-12-23 07:01:59 +00:00
imp
c8daf471f4 Avoid 'bogus' uninitialized warning by initializing rather than
playing cute games.  It is much simpler, clearer and easier to follow
and understand.  Besides, gcc4 likes it better.
2006-12-22 05:54:19 +00:00
rodrigc
6e71b264de The second argument (type) to socket(2) is an enum, not a bitmask, so parse
it as an enum.

If an SCTP SOCK_SEQPACKET socket was opened, kdump would display this
wrong output:
 socket(PF_INET,SOCK_STREAM|SOCK_RDM|SOCK_SEQPACKET,0x84)

instead of this correct output:
 socket(PF_INET,SOCK_SEQPACKET,0x84)

MFC after:	2 weeks
2006-12-22 05:07:21 +00:00
ru
54c3ccca4d Prevent a line from being broken on a line boundary. 2006-12-21 22:59:07 +00:00
ru
8a99132532 Improve markup. 2006-12-21 22:44:41 +00:00
ru
d9ff34ca5a Improve markup and do some minor wordsmithing. 2006-12-21 10:59:48 +00:00
ru
38f526ca48 Markup cosmetics. 2006-12-20 16:57:13 +00:00
ru
c3c62c2185 Document some details better, making it easier to translate. 2006-12-20 15:34:01 +00:00
ru
32424673a8 Be more accurate in the description of the -I option:
signaling to a process doesn't necessarily kill it.
2006-12-20 11:57:22 +00:00
cperciva
33a96f5f52 Remove -F option from getopts string -- this option has never done
anything apart from invoking usage(), and apparently slipped in by
accident.

Approved by:	kientzle
MFC after:	3 days
2006-12-20 06:56:25 +00:00
ru
73c3b50972 The -r option can also cause the files to be extended (not
necessarily truncated).
2006-12-19 11:20:34 +00:00
ru
b95ba6dd8d Refine markup and add the EXIT STATUS section where appropriate. 2006-12-19 10:34:14 +00:00
ru
b85b4a72c4 Improve markup. 2006-12-18 15:36:31 +00:00
dougb
64d068233d Fix the problem with the nsupdate(8) man page reported
in the PR by removing spurious .HP tags, thereby actually
allowing the commands to show up in the man page output,
and making the style consistent with the nslookup(1) man
page. [1]

While I'm here, fix the markup on the first command reference
in nslookup(1).

PR:		docs/98009 [1]
Submitted by:	Dmitry Kazarov <kazarov@ttk.ru>
2006-12-15 18:02:20 +00:00
ru
75044764a1 Fix the fix in rev. 1.15 so that we jump to the next column
instead of always skipping it.

MFC after:	3 days
2006-12-15 17:47:25 +00:00
ru
aeac2bd31e Fix markup. 2006-12-15 14:14:17 +00:00
ru
a1b968ead2 Fix one minor inaccuracy. 2006-12-15 13:40:53 +00:00
ru
e9575f7c7b Improve markup and grammar. 2006-12-15 13:37:49 +00:00
ru
8ec27d6b35 Mention what underlining is meant here. 2006-12-15 11:23:59 +00:00
ru
c18cdc85ca Fix markup. 2006-12-14 19:02:48 +00:00
ru
0f6441774b Polish markup and wording. 2006-12-14 00:02:44 +00:00
ru
f91f9bc30c Fix markup nits, add the EXIT STATUS section. 2006-12-13 20:15:49 +00:00
ru
154b86b1ef Fix the description of the -Btime primary.
Noticed by:	Vadim Goncharov <vadimnuclight tpu.ru>
2006-12-13 17:02:50 +00:00
ru
f57c769005 Refine the previous revision. 2006-12-13 12:09:41 +00:00
ru
26376028e8 "which -s" will return 0 only if all executables were found, not "any". 2006-12-13 12:07:49 +00:00
ru
f4831848ed It's `apply echo *'' that is similar to ls -1'', not `apply echo a*''.
Submitted by:	sat
2006-12-13 08:13:14 +00:00
csjp
1315da38ef Teach login(1) about the make.conf NO_AUDIT variable. This allows us to
conditionally build in audit support.

Submitted by:	bz
MFC after:	1 week
2006-12-13 06:13:32 +00:00
ru
164381741c Add missing markup bits. 2006-12-11 11:34:44 +00:00
delphij
ae1fcdf22f Use explicit braces to avoid ambiguous else. 2006-12-09 15:23:20 +00:00
mpp
f458d34cdf Do not exit without printing the id information if the uid of the
user executing the command cannot be looked up in the password file.
2006-12-09 12:58:14 +00:00
grog
8cd193c682 Change formatting to be more compliant with style(9). Doubtless
others will find more things to change.
2006-12-09 02:44:09 +00:00
grog
0c3cf23447 Change copyright notice to the FreeBSD 2 clause notice.
Approved by: John Wehle <john\@feith.com>
2006-12-09 02:33:26 +00:00
grog
85bdfaff80 Add copyright notice. 2006-12-09 02:31:24 +00:00
grog
ec0da9925e Set channel utility for Hauuapuge PVR-250 and PVR-350.
This s part of an import of the PVR-250 driver.  Originally it was
calleed pvr250-setchannel, but it seems better to improve this program
to work for any tuner card, so I'm starting with a more generic name.
That shouldn't mislead anybody: currently the program only works with
the (yet to be committed) cxm driver.

Contributed by: John Wehle <john\@feith.com>
2006-12-09 02:27:45 +00:00
nivit
1555dc07f7 - Added my entry in calendar.freebsd
Approved by:	alexbl (mentor)
2006-12-08 23:12:28 +00:00
maxim
ee86f7872a o confstr(3) returns 0 on error. Check the return value accordingly.
PR:		misc/106414
MFC after:	1 week
2006-12-06 12:00:26 +00:00
gabor
d62f25b0b5 - Add myself to calendar.freebsd
Approved by:	erwin (mentor)
MFC after:	3 days
2006-12-05 22:22:02 +00:00
cperciva
adde1adac2 Portability fix for non-POSIX operating systems: Open files in binary mode.
PR:		bin/106358
Submitted by:	techtonik at php dot net
2006-12-05 20:22:14 +00:00
dds
af51ff2234 Prevent buffer overflow when forcibly terminating an escape character.
Obtained from:	OpenBSD
Note: In the case of a full buffer the OpenBSD implementation will
leave in the format string an invalid escape sequence.  This appears
to be harmless with our C library, but according to C99 this can
cause undefined behavior.

MFC after:      2 weeks
2006-12-03 17:50:21 +00:00
dds
552b6c0ead Correct handling of format strings with escaped % specifications.
Note: It would be nice to be able to implement getformat() using
fmtcheck(3), but fmtcheck does not distinguish between signed and
unsigned types, a facility jot needs to perform range checks on its
output.

Submitted by:   Per Kristian Hove
MFC after:	2 weeks
2006-12-03 17:05:04 +00:00
keramida
b9438a6636 The sigconv.awk script generates a sigdesc.h header file, which
contains a sigdec[] vector of structures, but the generated output is
missing braces around the initializer of each struct, which
triggers warnings in WARNS=3:

src/usr.bin/top/sigdesc.h:10: warning: missing braces around initializer
src/usr.bin/top/sigdesc.h:10: warning: (near initialization for `sigdesc[0]')

  * Fix the sigconv.awk script to generate a header with initializers
    which look better.

  * Add rules to usr.bin/top/Makefile that rebuilds a new sigconv.h
    header which matches the correct signal set from the build-time
    version of `${DESTDIR}/usr/include/signal.h' (so sigconv.h doesn't
    get stale once changes are made to the header).

  * Remove the old sigconv.h header, now that it is autoupdated at
    build time.

  * Various Makefile style fixes (the committed Makefile was kindly
    submitted by Ruslan):

    - Reorder .PATH, PROG, SRCS and CFLAGS to match style.Makefile(5)
    - Split off the generated sources (sigdesc.h top.local.h) in an
      SRCS+= line of their own.
    - Add entries to CLEANFILES near the rules that generate the
      respective files.
    - Move the explicit rule which builds top.1 after the implicit
      rules which generate its dependencies.

Reviewed by:	ru, bde
Submitted by:	ru (Makefile)
MFC after:	2 weeks
2006-12-01 07:01:19 +00:00
ru
3b8270a3d5 - Revert signedness type changes to "struct vmtotal"; by making
them unsigned I made the possible overflows hard to detect,
  and it only saved 1 bit which isn't principal, even less now
  that the underlying issue with the total of virtual memory has
  been fixed.  (For the record, it will overflow with >=2T of
  VM total, with 32-bit ints used to keep counters in pages.)

- While here, fix printing of other "struct vmtotal" members
  such as t_rq, t_dw, t_pw, and t_sw as they are also signed.

Reviewed by:	bde
MFC after:	3 days
2006-11-28 12:46:02 +00:00
yar
5e5ca34442 Back out rev. 1.17: arch-dependent WARNS level.
The policy is that the WARNS level should characterize the
quality of a piece of code irrespective of any conditions.
Otherwise the code doesn't deserve the WARNS level assigned.

Requested by:	ru
2006-11-27 21:30:38 +00:00
yar
b3c89a4948 Consistently mark percentage scales as such.
PR:		bin/101975
MFC after:	3 days
2006-11-27 20:19:05 +00:00
yar
97045cf6d0 Don't shadow globals.
Found by:       WARNS=6
MFC after:      3 days
2006-11-27 19:50:50 +00:00
yar
ac0fbebe4a We should return the name in cp, not printf it.
Found by:	WARNS=6
MFC after:	3 days
2006-11-27 19:48:45 +00:00
yar
e21ee77276 systat(1) reaches WARNS=6 on i386 and amd64. This is good
for catching general regressions in future.  Unfortunately,
it still displays some problems at WARNS=6 on architectures
with stricter alignment requirements, e.g., ia64.
2006-11-27 17:54:28 +00:00
yar
0ceaba73fc The logic of fetchnetstat_sysctl() isn't too complex: if idx is 0,
we set and use xtp; if idx is 1, we set and use xip; the other cases
are impossible.  However, GCC cannot see that xip and xtp are always
initialized before use because they are initialized and used in
different if/else blocks.  So setting them to NULL at the very
beginning won't hurt.
2006-11-27 17:34:40 +00:00
yar
cf3ea4f2b8 + WARNS=4 reminds that nlist.n_name isn't const.
+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
  not to an empty string.
2006-11-27 17:24:36 +00:00
yar
23e0bb44c9 Don't discard a const qualifier from constant strings. 2006-11-27 17:01:31 +00:00
yar
a3471d7b5c Remove a wrong "const" qualifier.
Spotted by:	WARNS=6
2006-11-27 16:59:08 +00:00
yar
6c1cc19152 Add the Tera scale factor, which is an easy job now.
More scale factors would overflow the command line where
the help for "scale" were shown.
2006-11-27 16:33:44 +00:00
yar
2f8ab38300 Stop exposing things that can be private to convtbl.c. 2006-11-27 16:23:09 +00:00
yar
5218213e10 Keep all convtbl-related constants and strings in convtbl.[ch]. 2006-11-27 16:14:32 +00:00