Commit Graph

5161 Commits

Author SHA1 Message Date
Juli Mallett
47bca8b02c Clean up malloc(3)'s argument. Remove casts which do nothing when we're
using sizeof() anyway.  Use slightly more consistent (per-file) error
reporting for malloc(3) returning NULL.  If "malloc failed" was being printed,
don't use err(3).  If a NULL format is being used, use err(3).  In one case
errx(3) was being used with strerror(3), so just use err(3).
2002-05-17 05:11:07 +00:00
Juli Mallett
307a7436ec Remove spurious casts in malloc(3)'s argument.
Use `return' instead of `exit' at the bottom of main().
2002-05-17 02:28:46 +00:00
Tim J. Robbins
f5ba2b905e Add a Standards section, and note that compress(1) and uncompress(1) now
conform to P1003.1-2001.
2002-05-17 01:54:17 +00:00
Tim J. Robbins
b477159065 As required by SUSv3, a file argument of "-" causes standard input
to be compressed/decompressed to standard output.
2002-05-17 01:42:43 +00:00
Tim J. Robbins
783b4710d3 Compression ratio statistics should be written to stderr instead of stdout. 2002-05-17 01:25:51 +00:00
Tim J. Robbins
6c1b63bb06 Use exit status 2 to indicate that the file was not compressed because
its size would not be reduced (SUSv3).
2002-05-17 00:58:07 +00:00
Tim J. Robbins
9e49944008 Process and user ID arguments must be treated as decimal integers,
not octal or hex. This is the way it was before revision 1.10.

PR:		36950
Submitted by:	Peter Avalos <pavalos@theshell.com>
2002-05-16 23:55:35 +00:00
Tim J. Robbins
ae5a682066 Accept decimal user IDs with -u option as well as usernames.
PR:		36950
2002-05-16 23:44:11 +00:00
Tim J. Robbins
03ed70f315 Diagnostic messages belong on stderr, not stdout. SUSv3 specifies that
renice may not use stdout at all.
2002-05-16 23:30:38 +00:00
Peter Wemm
f81e3ffe10 OOPS! rev 1.16 accidently changed the default outfile from stderr to
stdout.  Unfortunately, DES mfc'ed this change in 1.15.2.1 (this
part probably should not have been) so it is broken there too.
truss is documented to use stderr, and other implementations use stderr.

Submitted by:	Arne Dag Fidjestøl <adf@idi.ntnu.no>
2002-05-16 21:58:57 +00:00
Tim J. Robbins
248602a1b2 Handle the case where a negative offset in a regular expression match
is larger than the number of lines in the overflow file.
2002-05-16 05:04:26 +00:00
Tim J. Robbins
bc0259551f Correct synopsis and usage(): pattern arguments are not optional. 2002-05-16 04:39:19 +00:00
Tom Rhodes
46c2a2cfa4 More consistancy. file system > filesystem 2002-05-16 02:19:14 +00:00
Tim J. Robbins
dfd339a02c Add the SUSv3 -l option to at. This is an alias for atq. Allow job ids
to be specified on the command line for which information should be reported.

Submitted by:	Joe Halpin <joe.halpin@attbi.com>
Reviewed by:	mike
2002-05-16 00:47:14 +00:00
Tony Finch
02f1d90bda Report errors properly if wait() fails.
PR:		30543
Approved by:	dwmalone (mentor)
MFC after:	3 weeks
2002-05-15 16:50:09 +00:00
Tony Finch
3f220dd51a Upgrade unifdef:
* It now knows about the existence of #elif which would have
    caused it to produce incorrect results in some situations.

  * It can now process #if and #elif lines according to the
    values of symbols that are specified on the command line.
    The expression parser is only a simple subset of what C
    allows but it should be sufficient for most real-world
    code (it can cope with everything it finds in xterm).

  * It has an option for printing all of the symbols that might
    control #if processing. The unifdefall script uses this
    option along with cpp -dM to strip all #ifs from a file.

  * It has much larger static limits.

  * It handles nested #ifs much more completely.

There have also been many style improvements: KNF; ANSI function
definitions; all global stuff moved to the top of the file; use
stdbool instead of h0h0bool; const-correctness; err(3) instead
of fprintf(stderr, ...); enum instead of #define; commentary.

I used NetBSD's unifdef as the basis of this since it has received
the most attention over the years.

PR:		37454
Reviewed by:	markm, dwmalone
Approved by:	dwmalone (mentor)
MFC after:	3 weeks
2002-05-15 16:30:28 +00:00
Tim J. Robbins
cba9c8bdd1 Build the asa(1) utility.
PR:		36130
Reviewed by:	mike
2002-05-15 03:37:55 +00:00
Tim J. Robbins
a3778ff65c #include <unistd.h> for getopt() and friends.
PR:		36130
Approved by:	mike
2002-05-15 03:31:40 +00:00
Tim J. Robbins
66562e1aac Use getopt() to reject options (asa has none), and to the "--" end of options
marker. Exit non-zero if we cannot open one of the input files. Update
standards conformance and exit status statements in manual page.

PR:		36130
Approved by:	mike
2002-05-15 03:17:01 +00:00
Tim J. Robbins
8a99cbd53d Remove __P,
Don't prototype main(),
C89-style function declarations,
char **argv -> char *argv[] for main()

PR:		36130
Approved by:	mike
2002-05-15 03:10:17 +00:00
Tim J. Robbins
81c126e7d3 style(9): remove space between function name and opening parentheses,
sort variables, NULL is the null-pointer constant, remove unnecessary
braces.

PR:		36130
Approved by:	mike
2002-05-15 03:02:17 +00:00
Tim J. Robbins
3990fae77a Add the POSIX.2 asa utility, which interprets FORTRAN carriage-control
characters.

PR:		36130
Approved by:	mike
Obtained from:	NetBSD
2002-05-15 02:40:57 +00:00
Brian Feldman
e7b663eff2 o Clean up tmp file usage a little by using mkstemp(3) instead of
mktemp(3).  It would be amazingly unlikely, but the former method
  could result in a symlink attack.  A better solution would use
  ${TMPDIR}, though.
o Make sed not overwrite old backup files with no warning.
2002-05-14 23:15:42 +00:00
Juli Mallett
5706d2e811 Fix a "tiny and squeeby and little" markup mistake.
Submitted by:	fenner
2002-05-14 22:55:31 +00:00
David Malone
d0b3489447 Make a link from fr_FR.ISO8859-1 to fr_FR.ISO8859-15.
Submitted by:	wollman
2002-05-13 21:30:23 +00:00
Tim J. Robbins
c8d3b41d7c If we can't change the scheduling priority, warn but still execute
the requested utility. This is how nice(1) traditionall behaved,
and the behaviour required by SUSv3 and POSIX.2 UPE.

Submitted by:	Peter Avalos <pavalos@theshell.com> (partially)
Reviewed by:	mike
2002-05-13 08:03:20 +00:00
Tim J. Robbins
7e91d5f926 Support the SUSv3 -n option and the "--" end of options marker.
Replace "command" with "utility" in the manual page & source to be more
consistent with the terminology used in the standard, and to hint that
shell builtin commands won't work.

Submitted by:	Peter Avalos <pavalos@theshell.com> (partially)
Approved by:	mike
2002-05-12 22:49:48 +00:00
Ruslan Ermilov
c7b111cba8 Added new bsd.incs.mk which handles installing of header files
via INCS.  Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files.  Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1.  Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

	kerberos5/lib/libtelnet/Makefile
	lib/libbz2/Makefile
	lib/libdevinfo/Makefile
	lib/libform/Makefile
	lib/libisc/Makefile
	lib/libmenu/Makefile
	lib/libmilter/Makefile
	lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD.  Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".
2002-05-12 16:01:00 +00:00
Bruce Evans
0b94059ea3 Fixed 5 style bugs in VCS ids. 2002-05-12 04:02:57 +00:00
Mike Barcroft
b2c80b69eb Finish converting the rest of the function declaration and prototypes
to ANSI C.  Use new source ID scheme.
2002-05-12 03:56:34 +00:00
Bruce Evans
a8f9c5c794 Fixed printing the the strip binary's name in error messages. 2002-05-12 03:47:23 +00:00
Brian S. Dean
73f899cae1 To perform even basic error checking, one must have an exit code that
indicates that not everything worked as expected.  Exit non-zero if we
timed out while transmitting or receiving a file or if the file did
not exist, etc.

MFC After:	3 days (re@ willing)
2002-05-12 01:47:50 +00:00
Marcel Moolenaar
441b1ec776 Add support for stripping non-native object files by using an
environment variable that specifies the name of the strip(1)
program to use. The envvar is "STRIPBIN". The more natural
choice would be "STRIP", but that one is taken already.
2002-05-11 19:15:15 +00:00
Alfred Perlstein
3a9818f926 unbreak build:
K&R style main() makes gcc emit a warning about missing prototypes so
switch to ANSI.
2002-05-11 03:29:04 +00:00
Chris D. Faulhaber
753d42d2ea #include <stdlib.h> for exit(3) prototype. 2002-05-11 03:18:14 +00:00
David E. O'Brien
498e57a7a4 BWK awk appears to work for world builds just fine now. We want to make
sparc64 the same as the other platforms -- so do it by moving the other
platforms toward the sparc64.
2002-05-10 20:36:21 +00:00
Ruslan Ermilov
8e0a87c1b3 xargs.c,v 1.33 broke the upgrade path from old versions of 4.x and 5.0. 2002-05-10 13:06:34 +00:00
Thomas Gellekum
486730f7fd Cast the uc_mcontext member to regcontext *, not the whole ucontext_t.
PR:		35449
Submitted by:	Stefan Farfeleder <e0026813@stud3.tuwien.ac.at>
2002-05-10 10:40:46 +00:00
Thomas Gellekum
ca25eaf630 Fix wrong bitmask. 2002-05-10 10:37:57 +00:00
Tim J. Robbins
c17fd4b5cf According to POSIX, exit status must be 127 if the requested utility was not
found, 126 if the execvp() failed for any other reason.

Similar to rev. 1.6 to src/usr.bin/env/env.c

Reviewed by:	mike
2002-05-10 06:39:16 +00:00
Tim J. Robbins
38a9994201 Reimplement the who(1) utility to add some features required by SUSv3:
-H option (show column headings),
-T (show mesg(1) state),
-m (same as "am I"),
-u (show idle time),
-q (quick mode; list names in columns).

PR:		36128
Reviewed by:	mike
2002-05-09 23:04:40 +00:00
Josef Karthauser
1063e12617 Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
Dag-Erling Smørgrav
7dac28cfc3 Back out part of previous commit - K&R doesn't have const. 2002-05-09 11:24:58 +00:00
Dag-Erling Smørgrav
0081eff379 Make _msgout take a const char * rather than a char *.
Sponsored by:	DARPA, NAI Labs
2002-05-08 14:50:28 +00:00
Jun Kuriyama
18ddb1400d Change whtespace indent in format string to fit new output form of
timestamp.

Reviewed by:	markm
2002-05-08 11:23:45 +00:00
Dag-Erling Smørgrav
f882171a2e These files haven't been used in a while. 2002-05-08 01:35:22 +00:00
Dag-Erling Smørgrav
f1d0592537 Use libutil and libypclnt for all passwd manipulation and NIS needs.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:54:29 +00:00
Dag-Erling Smørgrav
c8466cf99c Really include <paths.h> (it seems it was brought in indirectly) 2002-05-08 00:47:02 +00:00
Dag-Erling Smørgrav
99b82bb76a Use <paths.h> rather than "pathnames.h", and fix a couple of whitespace nits.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:47:01 +00:00
Juli Mallett
90f7fe63e9 Oops, update usage() to have -i. 2002-05-07 23:33:44 +00:00