Commit Graph

9392 Commits

Author SHA1 Message Date
dwmalone
fd23c264ca This now passes a make universe with WARNS=6. 2010-01-07 09:47:05 +00:00
dwmalone
f46bb1399f This now passes a make universe with WARNS=6. 2010-01-07 09:45:15 +00:00
kientzle
c2cd581d53 When restoring files, use the mode for the mode.
Thanks to: Jun Kuriyama for pointing this out
2010-01-06 06:35:10 +00:00
dwmalone
fa4a359159 1) Mark usage as dead2.
2) Deregister.
3) New style function definitions.

Some WARNS still remain here - some printf format warning on some
arches and the compiler can't see that a variable should always be
initialised.
2010-01-05 21:09:59 +00:00
dwmalone
a3da51fe8d Shuffle parens to avoid type-punning warning. 2010-01-05 21:00:23 +00:00
dwmalone
ca1f8c06ce 1) Make usage() as dead2 - it helps the compiler know that some vars
are not used uninitialised.
2) Fix some constness problems.
3) Avoid a signedness problem by casting to size_t. If bn != stuff,
than stuff-1-bn should be > 0.
2010-01-05 20:53:55 +00:00
dwmalone
824b5e2021 Change a char that is used as an index into an array into an unisgned char.
Add a missing new style function definition.
2010-01-05 20:32:08 +00:00
obrien
d2744b88e9 Add ability to search up the directory hierarchy for the system directory.
Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable.

Reviewed by:	<sjg@NetBSD.org>
Obtained from:	NetBSD (+ embellishment by me, sent back to NetBSD)
2010-01-04 18:57:22 +00:00
kib
d061de008a Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions,
so we better follow too (older glibc used old BSDish alphasort prototype
and corresponding type of the comparision function for scandir). While
there, change the definitions of the functions to ANSI C and fix several
style issues nearby.

Remove requirement for "sys/types.h" include for functions from manpage.

POSIX also requires that alphasort(3) sorts as if strcoll(3) was used,
but leave the strcmp(3) call in the function for now.

Adapt in-tree callers of scandir(3) to new declaration. The fact that
select_sections() from catman(1) could modify supplied struct dirent is
a bug.

PR:	standards/142255
MFC after:	2 weeks
2010-01-04 15:40:17 +00:00
obrien
d3158f2b66 Report lines that ought to contain a ':' operator but start with a '.'
as "Unknown directive" sinze they are more likely to be .elseif (etc).
(NetBSD PR 37222).

Obtained from:	NetBSD
2010-01-04 00:49:04 +00:00
obrien
0604e3cfcc Add check for subversion "original" marker. 2010-01-04 00:32:22 +00:00
gavin
8f4db7ad0c Fix return code in the case of successful file transfer, broken in
tftp.c 1.13

PR:		bin/117452
Submitted by:	Spencer Minear  minear securecomputing.com
Approved by:	ed (mentor)
MFC after:	2 weeks
2010-01-03 13:48:58 +00:00
ed
9b380e30d4 Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
ed
14b790b0cf Mute some warnings on uninitialized variables.
The code does the right thing, but the compiler is unable to figure it
out. All paths that use that variable use the same invariant.
2010-01-02 10:14:35 +00:00
ed
0db0a6763d Remove a warning by adding extra parentheses.
GCC generates warnings when using "if (foo = bar)". In this case its use
is valid.
2010-01-02 10:13:21 +00:00
ed
2f011fb7c4 Add missing #include for string routines. 2010-01-02 10:12:12 +00:00
ed
b2f1332428 ANSIfy various tools in usr.bin/.
Most of these tools properly build at WARNS=6, except for their K&R
function declarations. Fix this, so we can bump WARNS as well.
2010-01-02 10:09:20 +00:00
brooks
a5cc24440b The devices that supported EVFILT_NETDEV kqueue filters were removed in
r195175.  Remove all definitions, documentation, and usage.

fifo_misc.c:
	Remove all kqueue tests as fifo_io.c performs all those that
	would have remained.

Reviewed by:	rwatson
MFC after:	3 weeks
X-MFC note:	don't change vlan_link_state() function signature
2009-12-31 20:29:58 +00:00
ru
c056a4415d Treat an empty argument as an error, instead of fetching the
contents of the root directory.

MFC after:	1 week
2009-12-30 23:01:49 +00:00
ed
1126c5fc83 Let both yacc and lex generate code that passes -Wold-style-definition.
Both these tools emit code where several functions have no `void'
keyword placed in the arugment list when the function has no arguments.
2009-12-30 22:46:08 +00:00
ed
b9ca89bfc4 ANSIfy almost all applications that use WARNS=6.
I was considering committing all these patches one by one, but as
discussed with brooks@, there is no need to do this. If we ever
need/want to merge these changes back, it is still possible to do this
per application.
2009-12-29 22:53:27 +00:00
ed
49e7706638 Add missing `void' keyword. 2009-12-29 22:33:07 +00:00
ed
5f412839eb Add missing `void' keyword. 2009-12-29 22:32:43 +00:00
ed
1b17641937 Add missing `void' keyword for function without arguments. 2009-12-29 08:54:03 +00:00
kientzle
54b5963bf8 ar only needs to support ar format. 2009-12-29 05:58:40 +00:00
ed
5bf232465b Migrate finger(1) away from <utmp.h>.
Unfortunately it also uses lastlog, which means we must resort to local
extensions of the utmpx-interface. Because the user name and TTY name
are now nul-terminated, there is no need to copy around strings as
often.
2009-12-28 20:54:34 +00:00
ed
2062dc2dbf Several refinements to libulog's API.
- Only set the fields in the ulog_utmpx structure that are valid for the
  command in question. This means that strings like "shutdown" or "~"
  are not visible to the user anymore.
- Rename UTXF_* to UTXI_*, indicating the indexation, instead of using
  the `antique' filename. If we ever get rid of utmp, it makes little
  sense calling it by its old name.
2009-12-26 22:36:05 +00:00
delphij
342eec8689 Fix grammar and reduce ambiguity.
Submitted by:	b. f. <bf1783 googlemail com>
2009-12-26 00:46:05 +00:00
ed
2f4287b133 Let the width of the username column depend on the rwho file format.
Right now the code uses UT_NAMESIZE, but this makes little sense,
because rwho(1) parses files generated by rwhod(8). Not utmp(5) files.
2009-12-25 20:07:48 +00:00
delphij
159997fff7 Document the difference between FreeBSD and traditional System V killall
commands.

MFC after:	1 month
2009-12-25 10:01:35 +00:00
ed
a0fa5bcb40 Allow proper tracing of posix_openpt(2). 2009-12-23 15:22:50 +00:00
jh
93c61e374a Don't print the archive name with -p and -q options.
PR:		bin/141280
Approved by:	des, trasz (mentor)
2009-12-22 15:13:16 +00:00
delphij
53f77f22a0 Plug a memory leak.
PR:		bin/141836
Submitted by:	Henning Petersen <henning.petersen at t-online.de>
MFC after:	2 weeks
2009-12-21 19:15:30 +00:00
jh
34da792643 Cast time_t values to intmax_t and use %jd with printf.
OK'ed by:	delphij
Approved by:	trasz (mentor)
2009-12-21 17:41:57 +00:00
jh
2eaf7d742e Remove non-working special case for pipe(2) from amd64-fbsd32.c and
i386-fbsd.c. Add pipe(2) to syscall table to decode it's pointer
argument properly and re-add special handling for pipe(2) return value
to print_syscall_ret().

PR:		bin/120870
Approved by:	trasz (mentor)
2009-12-21 17:38:13 +00:00
des
6b03d5e862 Note that sockstat(1) does not display kernel-owned sockets.
Submitted by:	infofarmer@
MFC after:	2 weeks
2009-12-21 17:23:04 +00:00
jh
05e68d005a Avoid sharing the file descriptor of the output file with traced
processes by setting the FD_CLOEXEC flag for the output file.

PR:		bin/140493
Submitted by:	Erik Lax
OK'ed by:	delphij
Approved by:	trasz (mentor)
2009-12-20 11:00:53 +00:00
jh
d51d2e56fc Add fork(2), getegid(2), geteuid(2), getgid(2), getpid(2), getpgid(2),
getpgrp(2), getppid(2), getsid(2) and getuid(2) to syscall table to
decode their arguments correctly.

OK'ed by:	delphij
Approved by:	trasz (mentor)
2009-12-20 10:58:34 +00:00
edwin
1c45e9d066 Nationalise Easter -> Pasen
MFC after:	1 week
2009-12-17 20:41:59 +00:00
jh
060a87e0f5 Sync getline() with comm(1):
- Prevent overflowing of the buffer length variable in getline() by
   limiting its maximum value.
 - Exit if reallocf(3) fails in getline(). Failure was silently
   considered as end-of-file.

Reviewed by:	ghelmer
Approved by:	trasz (mentor)
2009-12-17 17:03:47 +00:00
jh
4491896aee The input line length limit mentioned on the manual page was removed by
r176119.

Approved by:	trasz (mentor)
2009-12-17 16:59:19 +00:00
stas
9b4a1c7a67 - Partially revert r200417. config.h brings several definitions,
that appears to be actually used.  Without config.h included
  cross-build of world failed (at least for ARM).
2009-12-17 12:42:45 +00:00
rse
22655be88e rewind(3) is already declared to return 'void', so no need for an explicit cast 2009-12-17 08:42:44 +00:00
rse
803dcdc836 DEBUG is either defined or not defined for the 'calender' sources, so use #ifdef and not just #if -- both to be semantically correct and also to be aligned with the rest of the 'calendar' sources 2009-12-17 08:41:06 +00:00
rse
7687c41059 remove external reference to not (or at least no longer) existing variable 'myname' 2009-12-17 08:37:02 +00:00
edwin
a02a0979b1 Add Australian, New Zealand and Ukraian calendars to the "all" target".
MFC after:	1 week
2009-12-17 07:18:06 +00:00
jh
34aba95524 - Prevent overflowing of the buffer length variable in getline() by
limiting its maximum value.
- Exit if reallocf(3) fails in getline(). Failure was silently
  considered as end-of-file.

Reviewed by:	ghelmer
Approved by:	trasz (mentor)
2009-12-16 14:34:48 +00:00
delphij
f86f4aa6c8 Style improvements:
- Sort function prototypes;
 - Apply static on all function bodies.  To quote bde@:

> It is a good obfuscation to declare functions as static only in the
> prototype, so that you can't see the static for the actual function.
> The reverse obfuscation (with static only in the function definition)
> would make more sense, but is a constraint error.

Reviewed by:	bde
2009-12-14 16:54:39 +00:00
delphij
1d2fa62026 - Remove times.h from C programs that does not manipulate with time at
all.
 - Remove pathnames.h from all but io.c since it's the only module that
   used these definations.
2009-12-13 04:50:11 +00:00
delphij
b8aa1fdf4a egetopt.c does not use any stdlib.h definations, nor it referenced any
symbol from other module, so remove reference of stdlib.h and extern.h.

Verified with:	md5(1)
2009-12-13 04:34:51 +00:00