In addition to adding `static' where possible:
- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.
This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
Also add $FreeBSD$ to a few files to keep svn happy.
Discussed with: imp, rwatson
It was already ported to use libulog, which makes it simpler now. Be
sure to catch the error returned by setutxdb(). Otherwise it may perform
a lookup on the utx.active database.
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.
after tty entry by one space in order to provide extra spaces for
the tty entry. As a result, full pts names are now visible (up
to 999 pts's anyway):
Before:
Login Name TTY Idle Login Time Office Phone
robert Robert Watson *v0 3:55 Fri 02:54
robert Robert Watson p0 19 Sat 11:01
robert Robert Watson pts Sat 14:55
After:
Login Name TTY Idle Login Time Office Phone
robert Robert Watson *v0 5:08 Fri 02:54
robert Robert Watson p0 8 Sat 11:01
robert Robert Watson pts/5 Sat 14:55
MFC after: 1 week
included twice by lprint.c, which included both finger.h and extern.h.
finger.h, in turn, includes extern.h. The redundant include of extern.h
was removed from lprint.c, as part of this change, but the include guards
were added anyway out of spite.
print a warning, and set the idletime variable for the entry to -1;
then pick up the -1 later in sprint() and lprint() and ignore those
idle times by printing just whitespace. When third party applications,
such as kdm, insert utmp entries, they sometimes use strings like ":0",
which can't be stat()'d and currently result in warnings that are
not helpful to the user.
characters was reversed, resulting in some network appliances, including
at least some NAS devices from Ascend, not recognizing our finger(1)
request.
PR: 45914
Submitted by: J R Matthews <jrm@delta-e.com.au>
Approved by: re (rwatson)
MFC after: 2 weeks
a nop, but we'll probably want to keep it for compatibility with other
KAME-based systems.
Complained about by: Andrey Lakhno <land@dnepr.net>
MFC after: 3 days
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.
Reviewed by: md5
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).
cc1: warnings being treated as errors
usr.bin/finger/lprint.c: In function `lprint':
usr.bin/finger/lprint.c:191: warning: precision is not type int (arg 2)
*** Error code 1
Pointy hat to: markm
of the recent WARNS commits. The idea is:
1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.