Commit Graph

8364 Commits

Author SHA1 Message Date
Craig Rodrigues
8bc31d836f 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
Craig Rodrigues
d18b5b8ca1 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
Craig Rodrigues
4c8dc49a4a 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
Colin Percival
1b720f2a86 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
Colin Percival
d82088b28f 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 Konovalov
1bfbae3533 o Grammar: is appears -> appears.
PR:		docs/107306
Submitted by:	Tomas Mozes
MFC after:	1 week
2006-12-31 07:22:55 +00:00
Yaroslav Tykhiy
9b3d1b0253 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
Stefan Farfeleder
703dfcbeb9 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
Ruslan Ermilov
8abab4f01b Fix tab lossage. 2006-12-29 06:44:24 +00:00
Ruslan Ermilov
391fb00db7 Remove extraneous whitespace. 2006-12-29 06:39:35 +00:00
Ruslan Ermilov
c343ecf7ee The Christmas holidays were not showing up due to missing <tab>. 2006-12-29 06:36:32 +00:00
Ruslan Ermilov
0a1cf344b7 Fix markup nit. 2006-12-28 10:58:06 +00:00
Ruslan Ermilov
16c1a8c6a2 Fix markup. 2006-12-28 04:58:38 +00:00
Ruslan Ermilov
bf42b54c6c - Remove the ambiguity in the input format description.
- Fix markup while here.
2006-12-27 14:56:18 +00:00
Ruslan Ermilov
3f7358b96b Simplify. 2006-12-26 12:43:12 +00:00
Dryice Dong Liu
2875ba4a9f Add my birthday to calendar.freebsd
Approved by:	itetcu (mentor)
2006-12-26 11:33:26 +00:00
Ruslan Ermilov
14f56c2242 Say "utility", not "function". 2006-12-26 10:37:37 +00:00
Ruslan Ermilov
906d81412d Fix markup. 2006-12-25 20:30:10 +00:00
Ruslan Ermilov
b9716d6879 Markup nits. 2006-12-24 19:55:38 +00:00
Ruslan Ermilov
61125887f3 Markup revision. 2006-12-24 19:18:52 +00:00
Ruslan Ermilov
30ee21d0dc Document the -d option. 2006-12-24 14:23:35 +00:00
Ruslan Ermilov
104c9971ee Fix markup. 2006-12-24 13:58:17 +00:00
Yaroslav Tykhiy
499a1062fa Add missing things: a prototype and a const qualifier.
Found by:	WARNS=4
2006-12-23 22:39:38 +00:00
Ruslan Ermilov
0dd4da1c1f Nits. 2006-12-23 19:15:39 +00:00
Yaroslav Tykhiy
c19a20a7d1 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
Yaroslav Tykhiy
d668a4922f Clear to EOL after the end of meter so that its reading can decrease. 2006-12-23 18:03:10 +00:00
Yaroslav Tykhiy
b20870dbb5 Make it possible for meter to reach 100% mark when swap is totally full. 2006-12-23 17:46:32 +00:00
Ruslan Ermilov
edea595c91 Improve markup. 2006-12-23 17:14:01 +00:00
Yaroslav Tykhiy
c1b118da86 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
Yaroslav Tykhiy
aee701a96e Reposition the "(swap not configured)" sign WRT the new layout. 2006-12-23 16:48:29 +00:00
Yaroslav Tykhiy
a3600374b4 Eliminate a couple of screen coordinate variables
that were useless and just obfuscated the code.
2006-12-23 16:39:09 +00:00
Yaroslav Tykhiy
12912b5a4a Add some vertical whitespace for easier reading. 2006-12-23 16:31:06 +00:00
Yaroslav Tykhiy
cb059cfe92 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
Yaroslav Tykhiy
7fb2f46a48 Fix the Total line shown if there are >1 swap devices. 2006-12-23 14:30:50 +00:00
Yaroslav Tykhiy
1f4d2a1d84 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
Colin Percival
d7102ae53c Fic typo in previous commit.
MFC after:	3 days
2006-12-23 08:16:54 +00:00
Colin Percival
5e522bbc27 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
Colin Percival
fe7f4a3aad Correct the names of some options.
MFC after:	3 days
2006-12-23 07:01:59 +00:00
Warner Losh
353bb0a3f8 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
Craig Rodrigues
7e3d8842da 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
Ruslan Ermilov
cf1fd21b68 Prevent a line from being broken on a line boundary. 2006-12-21 22:59:07 +00:00
Ruslan Ermilov
f0dd79bced Improve markup. 2006-12-21 22:44:41 +00:00
Ruslan Ermilov
dce95037f4 Improve markup and do some minor wordsmithing. 2006-12-21 10:59:48 +00:00
Ruslan Ermilov
c8c3587578 Markup cosmetics. 2006-12-20 16:57:13 +00:00
Ruslan Ermilov
44fce1caa1 Document some details better, making it easier to translate. 2006-12-20 15:34:01 +00:00
Ruslan Ermilov
0f07cf12ac 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
Colin Percival
6d3d33dd7a 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
Ruslan Ermilov
5eccbe45a7 The -r option can also cause the files to be extended (not
necessarily truncated).
2006-12-19 11:20:34 +00:00
Ruslan Ermilov
fe0e364354 Refine markup and add the EXIT STATUS section where appropriate. 2006-12-19 10:34:14 +00:00
Ruslan Ermilov
c03c456567 Improve markup. 2006-12-18 15:36:31 +00:00
Doug Barton
53cccb2d3b 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
Ruslan Ermilov
090782f5d5 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
Ruslan Ermilov
23207f2f39 Fix markup. 2006-12-15 14:14:17 +00:00
Ruslan Ermilov
8ad8d83a6b Fix one minor inaccuracy. 2006-12-15 13:40:53 +00:00
Ruslan Ermilov
f24d6f508b Improve markup and grammar. 2006-12-15 13:37:49 +00:00
Ruslan Ermilov
76682b268e Mention what underlining is meant here. 2006-12-15 11:23:59 +00:00
Ruslan Ermilov
89273e7b6c Fix markup. 2006-12-14 19:02:48 +00:00
Ruslan Ermilov
11180a85e1 Polish markup and wording. 2006-12-14 00:02:44 +00:00
Ruslan Ermilov
8db32b2016 Fix markup nits, add the EXIT STATUS section. 2006-12-13 20:15:49 +00:00
Ruslan Ermilov
3b0fbd312c Fix the description of the -Btime primary.
Noticed by:	Vadim Goncharov <vadimnuclight tpu.ru>
2006-12-13 17:02:50 +00:00
Ruslan Ermilov
22ae0cec0b Refine the previous revision. 2006-12-13 12:09:41 +00:00
Ruslan Ermilov
531ab78a73 "which -s" will return 0 only if all executables were found, not "any". 2006-12-13 12:07:49 +00:00
Ruslan Ermilov
6a2561eb26 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
Christian S.J. Peron
0c59c145ed 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
Ruslan Ermilov
353067fc31 Add missing markup bits. 2006-12-11 11:34:44 +00:00
Xin LI
82417e9f03 Use explicit braces to avoid ambiguous else. 2006-12-09 15:23:20 +00:00
Mike Pritchard
f2588359cb 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
Greg Lehey
fea218d5e0 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
Greg Lehey
e9fd2e2fcc Change copyright notice to the FreeBSD 2 clause notice.
Approved by: John Wehle <john\@feith.com>
2006-12-09 02:33:26 +00:00
Greg Lehey
978b137e05 Add copyright notice. 2006-12-09 02:31:24 +00:00
Greg Lehey
f59dc03825 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
Nicola Vitale
7972e25921 - Added my entry in calendar.freebsd
Approved by:	alexbl (mentor)
2006-12-08 23:12:28 +00:00
Maxim Konovalov
37716191a8 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 Kovesdan
f48837e7d4 - Add myself to calendar.freebsd
Approved by:	erwin (mentor)
MFC after:	3 days
2006-12-05 22:22:02 +00:00
Colin Percival
8904d5ecb1 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
Diomidis Spinellis
f88b45d7df 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
Diomidis Spinellis
34785a9fc0 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
Giorgos Keramidas
d2d6d8d537 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
Ruslan Ermilov
bad4d172b4 - 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
Yaroslav Tykhiy
d3985f17d4 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
Yaroslav Tykhiy
65b02a0f4b Consistently mark percentage scales as such.
PR:		bin/101975
MFC after:	3 days
2006-11-27 20:19:05 +00:00
Yaroslav Tykhiy
04f7f23bf8 Don't shadow globals.
Found by:       WARNS=6
MFC after:      3 days
2006-11-27 19:50:50 +00:00
Yaroslav Tykhiy
da67074ec6 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
Yaroslav Tykhiy
c3d6542fd0 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
Yaroslav Tykhiy
599cc46d95 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
Yaroslav Tykhiy
6549e8c62e + 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
Yaroslav Tykhiy
9540596e83 Don't discard a const qualifier from constant strings. 2006-11-27 17:01:31 +00:00
Yaroslav Tykhiy
2506efa78c Remove a wrong "const" qualifier.
Spotted by:	WARNS=6
2006-11-27 16:59:08 +00:00
Yaroslav Tykhiy
dfaa9125d8 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
Yaroslav Tykhiy
afe7b9fbb5 Stop exposing things that can be private to convtbl.c. 2006-11-27 16:23:09 +00:00
Yaroslav Tykhiy
aee371e363 Keep all convtbl-related constants and strings in convtbl.[ch]. 2006-11-27 16:14:32 +00:00
Yaroslav Tykhiy
f5d4751c8a Allow for large scale factors. C99 warrants that
ULLONG_MAX is not less than 2^64-1; and uintmax_t
cannot be more narrow than unsigned long long.
This allows for scale factors up to Exa inclusively.

Use plain int for the scale index to be consistent
with ifcmds.c and enum.
2006-11-27 15:26:26 +00:00
Yaroslav Tykhiy
41af362198 Return back one initializer, it is needed. 2006-11-27 15:14:50 +00:00
Yaroslav Tykhiy
f301488570 + Drop useless initializers.
+ style(9).
2006-11-27 15:11:30 +00:00
Yaroslav Tykhiy
ce1bff762d Drop useless #includes. 2006-11-27 14:48:46 +00:00
Yaroslav Tykhiy
0230383747 Use C99 initializers so that we don't really have to worry
about the order of related things at several places.
2006-11-27 14:18:54 +00:00
Yaroslav Tykhiy
ab5c9a0d0a C can enumerate things for us. 2006-11-27 14:16:40 +00:00
Yaroslav Tykhiy
00603ea268 There is no reason to use __inline here because we are rather far
from a path critical to performance.
2006-11-26 20:14:47 +00:00
Yaroslav Tykhiy
a3736d312c Don't overflow from the gigabyte scale to the bit scale if the
number to auto-scale is >= 1024 Gb.  Could be triggered on arches
where ifdata counters had 64 bits.

Reported by:	Miroslav Slavkov on -net
MFC after:	3 days
2006-11-26 20:08:40 +00:00
Yaroslav Tykhiy
91857186f2 The real contents of this file were repeated twice.
The repetition was harmless due to a usual #ifndef _FOO_H_ wrapper.
Fortunately, nobody started to hack the second copy,
so just remove it from the file.

MFC after:	3 days
2006-11-26 19:25:10 +00:00