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
At least one port (net-mgmt/net-snmp) creates man-pages which are
in the format:
.SH NAME
The Net-SNMP agent \- The snmp agent responds to SNMP queries from management stations.
.PP
.SS "Modules"
At this moment, makewhatis determines the end of the .SH NAME section
as where it finds .SH again, but there is none here, is it "terminated"
by the .SS.
PR: bin/116706
Submitted by: edwin@
Approved by: re (Ken Smith), grog (mentor)
MFC after: 1 week
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
the new content size fits into the sbuf, instead of assuming
that allocating twice the old size is enough.
- Use memmove(3) rather than strcpy(3) to copy overlapping
strings.
PR: bin/39930
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
Submitted by: invalid opcode <coredump@nervosa.com>
makewhatis.local - start makewhatis(1) only for file systems
physically mounted on the system
Running makewhatis from /etc/weekly for rw nfs-mounted /usr may kill
your NFS server -- all clients start makewhatis at the same time!
So use this wrapper instead calling makewhatis directly.
Pointed out by: Bruce