]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoRemove if_carp.ko. /boot/kernel should be upgraded atomically.
Gleb Smirnoff [Mon, 19 Dec 2011 12:50:12 +0000 (12:50 +0000)]
Remove if_carp.ko. /boot/kernel should be upgraded atomically.

Requested by: netchild, bz

12 years agoUnbreak the build after r228697 adding the { } block to make clear which
Bjoern A. Zeeb [Mon, 19 Dec 2011 08:50:17 +0000 (08:50 +0000)]
Unbreak the build after r228697 adding the { } block to make clear which
if the else belongs to.

12 years agoo Convert IPv6 read-only stats sysctls to the read-write ones.
Maxim Konovalov [Mon, 19 Dec 2011 05:50:34 +0000 (05:50 +0000)]
o Convert IPv6 read-only stats sysctls to the read-write ones.
o Teach netstat(1) -z to reset these stats sysctls.

PR: bin/153206
Reviewed by: glebuis
Sponsored by: NGINX, Inc.
MFC after: 1 month

12 years agoo Sort .Xrs.
Maxim Konovalov [Mon, 19 Dec 2011 05:09:08 +0000 (05:09 +0000)]
o Sort .Xrs.

12 years agoRepair breakage after r228697: since m4 now uses pow(3), it needs -lm.
Dimitry Andric [Sun, 18 Dec 2011 23:54:32 +0000 (23:54 +0000)]
Repair breakage after r228697: since m4 now uses pow(3), it needs -lm.

Pointy hat to: bapt

12 years agoReimplement support for the ** (exponent) gnu extension, make it available thought...
Baptiste Daroussin [Sun, 18 Dec 2011 22:04:55 +0000 (22:04 +0000)]
Reimplement support for the ** (exponent) gnu extension, make it available thought the -g (mimic gnu) option

Reviewed by: cognet
Approved by: cognet
Discussed with: espie@OpenBSD.org (upstream)

12 years agoUse lex's standard way of not generating unused function.
Pawel Jakub Dawidek [Sun, 18 Dec 2011 20:41:58 +0000 (20:41 +0000)]
Use lex's standard way of not generating unused function.

Inspired by: r228555
MFC after: 1 week

12 years agoDon't use function name as format string.
Pawel Jakub Dawidek [Sun, 18 Dec 2011 20:40:19 +0000 (20:40 +0000)]
Don't use function name as format string.

Detected by: clang
MFC after: 1 week

12 years agoFix compilation on sparc64 by actually supplying the bus_dma_tag_t member
Marius Strobl [Sun, 18 Dec 2011 17:48:54 +0000 (17:48 +0000)]
Fix compilation on sparc64 by actually supplying the bus_dma_tag_t member
of the rx_ring to bus_dmamap_sync(9). Given that netmap code tries to
obtain the bus addresses of netmap buffers via vtophys(9) instead of using
bus_dma(9) it currently has zero chance of actually working on sparc64
though (and for that matter f.e. also not with MACs limited to 32-bit DMA
on x86 machines with more than 4GB of RAM).

12 years agoRevert r228603, and add the workaround to sbin/fsdb/Makefile instead.
Dimitry Andric [Sun, 18 Dec 2011 17:42:26 +0000 (17:42 +0000)]
Revert r228603, and add the workaround to sbin/fsdb/Makefile instead.

MFC after: 1 week

12 years agoUpgrade to OpenPAM Lycopsida.
Dag-Erling Smørgrav [Sun, 18 Dec 2011 17:22:45 +0000 (17:22 +0000)]
Upgrade to OpenPAM Lycopsida.

12 years agoVendor import of OpenPAM Lycopsida.
Dag-Erling Smørgrav [Sun, 18 Dec 2011 17:08:40 +0000 (17:08 +0000)]
Vendor import of OpenPAM Lycopsida.

12 years agoSupport infrastructure for X11 on PS3.
Nathan Whitehorn [Sun, 18 Dec 2011 16:53:21 +0000 (16:53 +0000)]
Support infrastructure for X11 on PS3.

Submitted by: geoffrey dot levand at mail dot ru
MFC after: 1 week

12 years agoAdd version header to output file.
Nathan Whitehorn [Sun, 18 Dec 2011 16:53:03 +0000 (16:53 +0000)]
Add version header to output file.

12 years agoUse FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.
Sergey Kandaurov [Sun, 18 Dec 2011 15:36:21 +0000 (15:36 +0000)]
Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.

Reviewed by: kib

12 years agoFrom time to time people report space map corruption resulting in panic
Pawel Jakub Dawidek [Sun, 18 Dec 2011 12:27:45 +0000 (12:27 +0000)]
From time to time people report space map corruption resulting in panic
(ss == NULL) on pool import. I had such a panic recently. With current version
of ZFS it is still possible to import the pool in readonly mode and backup
all the data, but in case it is impossible for some reason add tunable
vfs.zfs.space_map_last_hope, which when set to '1' will tell ZFS to remove
colliding range and retry. This seems to have worked for me, but I consider
it highly risky to use.

MFC after: 1 week

12 years agoImplement replying of ACLs updates. ACL changes should go to ZIL only
Pawel Jakub Dawidek [Sun, 18 Dec 2011 12:19:03 +0000 (12:19 +0000)]
Implement replying of ACLs updates. ACL changes should go to ZIL only
if the 'sync' property is set to 'always', so replying them is not common.

MFC after: 1 month

12 years agoForgot to add usr.sbin/sade/label.c in the previous commit.
Dimitry Andric [Sun, 18 Dec 2011 01:14:38 +0000 (01:14 +0000)]
Forgot to add usr.sbin/sade/label.c in the previous commit.

MFC after: 1 week

12 years agoIn usr.sbin/sade/install.c and usr.sbin/sade/label.c, fix a few warnings
Dimitry Andric [Sun, 18 Dec 2011 01:13:21 +0000 (01:13 +0000)]
In usr.sbin/sade/install.c and usr.sbin/sade/label.c, fix a few warnings
about format strings not being literals.

MFC after: 1 week

12 years agoIn usr.sbin/sa/db.c, avoid warnings about assigning two const char
Dimitry Andric [Sun, 18 Dec 2011 01:08:25 +0000 (01:08 +0000)]
In usr.sbin/sa/db.c, avoid warnings about assigning two const char
arrays to non-const void pointers, by casting away const explicitly.

MFC after: 1 week

12 years agoIn usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
Dimitry Andric [Sun, 18 Dec 2011 00:55:46 +0000 (00:55 +0000)]
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
like time_t, better use %jd instead of %ju.  Strangely enough, neither
gcc, clang nor gcc 4.6 warn about this discrepancy...

MFC after: 1 week

12 years agoIn usr.sbin/rpc.ypupdated/yp_dbupdate.c, include stdint.h, so intmax_t
Dimitry Andric [Sun, 18 Dec 2011 00:44:59 +0000 (00:44 +0000)]
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, include stdint.h, so intmax_t
is known, otherwise it won't build.

Pointy hat to: dim
MFC after: 1 week

12 years agoIn usr.sbin/rpc.ypupdated/yp_dbupdate.c, use the appropriate printf
Dimitry Andric [Sun, 18 Dec 2011 00:40:30 +0000 (00:40 +0000)]
In usr.sbin/rpc.ypupdated/yp_dbupdate.c, use the appropriate printf
length modifier for time_t (after casting it to intmax_t).

MFC after: 1 week

12 years agoDisable another clang warning (-Wempty-body) when WARNS <= 2.
Dimitry Andric [Sun, 18 Dec 2011 00:34:42 +0000 (00:34 +0000)]
Disable another clang warning (-Wempty-body) when WARNS <= 2.

MFC after: 1 week

12 years agoDisable yet another clang warning (-Wconversion) when WARNS <= 3.
Dimitry Andric [Sun, 18 Dec 2011 00:24:11 +0000 (00:24 +0000)]
Disable yet another clang warning (-Wconversion) when WARNS <= 3.

MFC after: 1 week

12 years agoIn usr.sbin/route6d/route6d.c, use the correct printf length modifier
Dimitry Andric [Sun, 18 Dec 2011 00:03:03 +0000 (00:03 +0000)]
In usr.sbin/route6d/route6d.c, use the correct printf length modifier
for an ssize_t.

MFC after: 1 week

12 years agoIn usr.sbin/pw/pw_user.c, use the correct printf length modifier for a
Dimitry Andric [Sat, 17 Dec 2011 23:46:47 +0000 (23:46 +0000)]
In usr.sbin/pw/pw_user.c, use the correct printf length modifier for a
ptrdiff_t.

MFC after: 1 week

12 years agoIn contrib/pnpinfo/pnpinfo.c, remove an extraneous parameter from the
Dimitry Andric [Sat, 17 Dec 2011 23:43:40 +0000 (23:43 +0000)]
In contrib/pnpinfo/pnpinfo.c, remove an extraneous parameter from the
call to isolation_protocol().

MFC after: 1 week

12 years agoIn usr.sbin/pmccontrol/pmccontrol.c, fix a few warnings about format
Dimitry Andric [Sat, 17 Dec 2011 23:39:13 +0000 (23:39 +0000)]
In usr.sbin/pmccontrol/pmccontrol.c, fix a few warnings about format
strings not being literals.

MFC after: 1 week

12 years agoIn usr.sbin/pkg_install/updating/main.c, use the size of the destination
Dimitry Andric [Sat, 17 Dec 2011 23:35:46 +0000 (23:35 +0000)]
In usr.sbin/pkg_install/updating/main.c, use the size of the destination
buffer as size argument to strlcpy(), not the length of the source.

MFC after: 1 week

12 years agodu: Allow multiple -HLP options, the last one wins.
Jilles Tjoelker [Sat, 17 Dec 2011 23:18:14 +0000 (23:18 +0000)]
du: Allow multiple -HLP options, the last one wins.

This matches 4.4BSD tradition and other utilities with these options and is
required by POSIX (POSIX does not specify -P, only -HL).

MFC after: 2 weeks

12 years agoRevert r228650, and work around the clang false positive with printf
Dimitry Andric [Sat, 17 Dec 2011 22:32:00 +0000 (22:32 +0000)]
Revert r228650, and work around the clang false positive with printf
formats in usr.bin/netstat/atalk.c by conditionally adding NO_WFORMAT to
the Makefile instead.

MFC after: 1 week

12 years agoIn usr.bin/csup/auth.c, cast time_t to intmax_t instead, and use the
Dimitry Andric [Sat, 17 Dec 2011 22:20:46 +0000 (22:20 +0000)]
In usr.bin/csup/auth.c, cast time_t to intmax_t instead, and use the
corresponding printf length modifier.

Requested by: mdf
MFC after: 1 week

12 years agoFix style and white spaces.
Mikolaj Golub [Sat, 17 Dec 2011 22:18:26 +0000 (22:18 +0000)]
Fix style and white spaces.

MFC after: 1 week

12 years agoUse NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
Dimitry Andric [Sat, 17 Dec 2011 22:16:27 +0000 (22:16 +0000)]
Use NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
x86, any alignment warnings can be safely ignored.  Define YY_NO_INPUT
in usr.sbin/ndiscvt/inf-token.l, so no unused lex functions are defined.

MFC after: 1 week

12 years agoIn usr.sbin/lpr/lpd/printjob.c, use the correct printf length modifiers
Dimitry Andric [Sat, 17 Dec 2011 22:05:28 +0000 (22:05 +0000)]
In usr.sbin/lpr/lpd/printjob.c, use the correct printf length modifiers
for off_t (aka int64_t).

MFC after: 1 week

12 years agoIn usr.sbin/lpr/filters/lpf.c, use a less obtuse way of clearing the
Dimitry Andric [Sat, 17 Dec 2011 21:37:21 +0000 (21:37 +0000)]
In usr.sbin/lpr/filters/lpf.c, use a less obtuse way of clearing the
buffer, that also avoids warnings.

MFC after: 1 week

12 years agoIn usr.sbin/keyserv, fix some implicit enum conversions, and use the
Dimitry Andric [Sat, 17 Dec 2011 20:53:06 +0000 (20:53 +0000)]
In usr.sbin/keyserv, fix some implicit enum conversions, and use the
correct printf length modifiers for uid_t.

MFC after: 1 week

12 years agoIn usr.sbin/iostat/iostat.c, use printf format specifiers from
Dimitry Andric [Sat, 17 Dec 2011 20:25:23 +0000 (20:25 +0000)]
In usr.sbin/iostat/iostat.c, use printf format specifiers from
inttypes.h for u_int64_t's.  While here, sort #include directives.

MFC after: 1 week

12 years agoIn usr.sbin/i2c/i2c.c, fix a few warnings about format strings not being
Dimitry Andric [Sat, 17 Dec 2011 20:12:17 +0000 (20:12 +0000)]
In usr.sbin/i2c/i2c.c, fix a few warnings about format strings not being
literals.

MFC after: 1 week

12 years agoIn usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c, cast a printf field width
Dimitry Andric [Sat, 17 Dec 2011 20:07:42 +0000 (20:07 +0000)]
In usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c, cast a printf field width
parameter to int.

MFC after: 1 week

12 years agoUse NO_WCAST_ALIGN for usr.sbin/cpucontrol; because this is only built
Dimitry Andric [Sat, 17 Dec 2011 19:58:48 +0000 (19:58 +0000)]
Use NO_WCAST_ALIGN for usr.sbin/cpucontrol; because this is only built
for x86, any alignment warnings can be safely ignored.

MFC after: 1 week

12 years agoIn usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
Dimitry Andric [Sat, 17 Dec 2011 19:53:08 +0000 (19:53 +0000)]
In usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
enumeration types for the mesh_peering and mesh_forwarding members of
struct wlan_iface, to fix enum conversion warnings.

MFC after: 1 week

12 years agoUse NO_WCAST_ALIGN for usr.sbin/boot0cfg; because this is only built for
Dimitry Andric [Sat, 17 Dec 2011 19:33:26 +0000 (19:33 +0000)]
Use NO_WCAST_ALIGN for usr.sbin/boot0cfg; because this is only built for
x86, any alignment warnings can be safely ignored.

MFC after: 1 week

12 years agoIn usr.sbin/bluetooth/sdpd/server.c, don't use the size of a pointer as
Dimitry Andric [Sat, 17 Dec 2011 19:26:03 +0000 (19:26 +0000)]
In usr.sbin/bluetooth/sdpd/server.c, don't use the size of a pointer as
the length argument to memset, but the size of the object pointed to.

MFC after: 1 week

12 years agoIn usr.bin/vmstat/vmstat.c, cast several printf field widths to int, and
Dimitry Andric [Sat, 17 Dec 2011 19:22:24 +0000 (19:22 +0000)]
In usr.bin/vmstat/vmstat.c, cast several printf field widths to int, and
use printf format specifiers from inttypes.h for uint64_t's.

MFC after: 1 week

12 years agoFix unused parameter warnings.
Michael Tuexen [Sat, 17 Dec 2011 19:21:40 +0000 (19:21 +0000)]
Fix unused parameter warnings.
While there, fix some whitespace issues.

MFC after: 3 months.

12 years agoUnfortunately, clang gives warnings about sendmail code that cannot be
Dimitry Andric [Sat, 17 Dec 2011 18:39:04 +0000 (18:39 +0000)]
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after: 1 week

12 years agoIn contrib/telnet/telnet/utilities.c, fix a few warnings about format
Dimitry Andric [Sat, 17 Dec 2011 18:18:36 +0000 (18:18 +0000)]
In contrib/telnet/telnet/utilities.c, fix a few warnings about format
strings not being literals.

MFC after: 1 week

12 years agoIn usr.bin/netstat/atalk.c, work around a clang false positive with
Dimitry Andric [Sat, 17 Dec 2011 17:21:47 +0000 (17:21 +0000)]
In usr.bin/netstat/atalk.c, work around a clang false positive with
printf format warnings and conditional operators.

MFC after: 1 week

12 years agoUse NO_WCAST_ALIGN for usr.bin/ncplist, as there are many potential
Dimitry Andric [Sat, 17 Dec 2011 17:04:30 +0000 (17:04 +0000)]
Use NO_WCAST_ALIGN for usr.bin/ncplist, as there are many potential
alignment issues in it.  (Though I doubt anyone still cares about
NetWare support...)

MFC after: 1 week

12 years agoOn start most of sysctl_kern_proc functions use the same pattern:
Mikolaj Golub [Sat, 17 Dec 2011 16:59:22 +0000 (16:59 +0000)]
On start most of sysctl_kern_proc functions use the same pattern:
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.

As the function may be useful not only in kern_proc.c it is in the
kernel name space.

Suggested by: kib
Reviewed by: kib
MFC after: 2 weeks

12 years agoIn usr.bin/mail/cmd1.c, use the correct printf length modifier for a
Dimitry Andric [Sat, 17 Dec 2011 16:30:42 +0000 (16:30 +0000)]
In usr.bin/mail/cmd1.c, use the correct printf length modifier for a
ptrdiff_t.  In usr.bin/mail/main.c, cast a field width to int.

MFC after: 1 week

12 years agoAdditional icache paranoia: non-PLT relocations can modify the text segment.
Nathan Whitehorn [Sat, 17 Dec 2011 16:20:27 +0000 (16:20 +0000)]
Additional icache paranoia: non-PLT relocations can modify the text segment.
It is then important to make sure the icache is synchronized again to
prevent (rare) random seg faults and illegal instructions.

MFC after: 3 days

12 years agoIn contrib/less, cast away const a bunch of times, to make it build
Dimitry Andric [Sat, 17 Dec 2011 16:10:14 +0000 (16:10 +0000)]
In contrib/less, cast away const a bunch of times, to make it build
without conversion warnings.  This code desparately needs a good dose of
const poison, but fixing all the issues would be rather disruptive.

MFC after: 1 week

12 years agosyscons: provide a first iteration of cngrab/cnungrab implementation
Andriy Gapon [Sat, 17 Dec 2011 15:57:39 +0000 (15:57 +0000)]
syscons: provide a first iteration of cngrab/cnungrab implementation

- put underlying keyboard(s) into the polling mode for the whole
  duration of the grab, instead of the previous behavior of going into
  and out of the polling mode around each polling attempt
- ditto for setting K_XLATE mode and enabling a disabled keyboard

Inspired by: bde
MFC after: 2 months

12 years agobelatedly transfer copyrights from libkern/gets.c to kern_cons.c
Andriy Gapon [Sat, 17 Dec 2011 15:50:45 +0000 (15:50 +0000)]
belatedly transfer copyrights from libkern/gets.c to kern_cons.c

MFC after: 2 months
MFC with: r228642

12 years agoretire libkern gets
Andriy Gapon [Sat, 17 Dec 2011 15:48:55 +0000 (15:48 +0000)]
retire libkern gets

Inspired by: bde
MFC after: 2 months
X-MFC-Note: if deemed a part of KPI, just call cngets internally

12 years agoAllow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum
Bjoern A. Zeeb [Sat, 17 Dec 2011 15:44:34 +0000 (15:44 +0000)]
Allow toggling of IFCAP_VLAN_HWCSUM for hardware that supports checksum
offloading on vlans and document the new option.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

12 years agoUnbreak the OCTEON1 kernel build after r228483 removing the left over
Bjoern A. Zeeb [Sat, 17 Dec 2011 15:42:37 +0000 (15:42 +0000)]
Unbreak the OCTEON1 kernel build after r228483 removing the left over
declaration.

MFC after: 11 days

12 years agoIn usr.bin/indent/io.c, fix a few warnings about format strings not being literals.
Dimitry Andric [Sat, 17 Dec 2011 15:41:58 +0000 (15:41 +0000)]
In usr.bin/indent/io.c, fix a few warnings about format strings not being literals.

MFC after: 1 week

12 years agomove GETS_*ECHO* defintions from libkern.h to cons.h
Andriy Gapon [Sat, 17 Dec 2011 15:39:14 +0000 (15:39 +0000)]
move GETS_*ECHO* defintions from libkern.h to cons.h

MFC after: 2 months

12 years agoAnother axe(4), found in ASUS zenbook.
Kevin Lo [Sat, 17 Dec 2011 15:38:16 +0000 (15:38 +0000)]
Another axe(4), found in ASUS zenbook.

12 years agoCorrect a logic error in usr.bin/hexdump/conv.c, found by clang.
Dimitry Andric [Sat, 17 Dec 2011 15:33:26 +0000 (15:33 +0000)]
Correct a logic error in usr.bin/hexdump/conv.c, found by clang.

Whenever the conv_c() function encounters an incomplete multibyte char,
it peeks ahead.  It also sets p to peekbuf, to indicate it is still
processing the incomplete character.

However, on the next retry, it compares buf against peekbuf, which
always returns false, since both buf and peekbuf are local char arrays,
whose addresses are never the same.

Fix this by comparing against p instead, which was the intention.  Also
turn peekbuf into an array of u_char, to prevent conversion warnings.

MFC after: 1 week

12 years agoFix RTLD on PowerPC after r228435. Changing the order of init_pltgot()
Nathan Whitehorn [Sat, 17 Dec 2011 15:31:00 +0000 (15:31 +0000)]
Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot()
caused the icache to be invalidated at the wrong time, resulting in
an icache full of nonsense in the PLT section.

12 years agoreplace uses of libkern gets with cngets
Andriy Gapon [Sat, 17 Dec 2011 15:26:34 +0000 (15:26 +0000)]
replace uses of libkern gets with cngets

MFC after: 2 months

12 years agointroduce cngets, a method for kernel to read a string from console
Andriy Gapon [Sat, 17 Dec 2011 15:16:54 +0000 (15:16 +0000)]
introduce cngets, a method for kernel to read a string from console

This is intended as a replacement for libkern's gets and mostly borrows
its implementation.  It uses cngrab/cnungrab to delimit kernel's access
to console input.

Note: libkern's gets obviously doesn't share any bits of implementation
iwth libc's gets.  They also have different APIs and the former doesn't
have the overflow problems of the latter.

Inspired by: bde
MFC after: 2 months

12 years agointroduce cngrab/cnungrab stub calls in some places where they make sense
Andriy Gapon [Sat, 17 Dec 2011 15:11:22 +0000 (15:11 +0000)]
introduce cngrab/cnungrab stub calls in some places where they make sense

MFC after: 2 months

12 years agokern cons: introduce infrastructure for console grabbing by kernel
Andriy Gapon [Sat, 17 Dec 2011 15:08:43 +0000 (15:08 +0000)]
kern cons: introduce infrastructure for console grabbing by kernel

At the moment grab and ungrab methods of all console drivers are no-ops.

Current intended meaning of the calls is that the kernel takes control of
console input.  In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).

Inspired by: bde
MFC after: 2 months

12 years agoAddress warnings found by clang.
Michael Tuexen [Sat, 17 Dec 2011 14:55:19 +0000 (14:55 +0000)]
Address warnings found by clang.

MFC after: 3 months.

12 years agoMore fixes for correct printf length modifiers usr.bin/gprof.
Dimitry Andric [Sat, 17 Dec 2011 14:51:24 +0000 (14:51 +0000)]
More fixes for correct printf length modifiers usr.bin/gprof.

MFC after: 1 week

12 years agoIn usr.bin/gprof/aout.c, use the correct printf length modifier for a
Dimitry Andric [Sat, 17 Dec 2011 14:37:41 +0000 (14:37 +0000)]
In usr.bin/gprof/aout.c, use the correct printf length modifier for a
uint32_t.

MFC after: 1 week

12 years agoIn contrib/ee/ee.c, fix a few warnings about format strings not being
Dimitry Andric [Sat, 17 Dec 2011 14:26:16 +0000 (14:26 +0000)]
In contrib/ee/ee.c, fix a few warnings about format strings not being
literals.  Also, change the direction argument to move_rel() from char
to int; K&R function definions cause it to be promoted to an int anyway,
and this way we avoid clang warning about it.

MFC after: 1 week

12 years agoIn usr.bin/csup/proto.c, use the correct printf length modifier to print
Dimitry Andric [Sat, 17 Dec 2011 13:52:53 +0000 (13:52 +0000)]
In usr.bin/csup/proto.c, use the correct printf length modifier to print
an off_t.

MFC after: 1 week

12 years agoIn usr.bin/csup/auth.c, use the correct number of bytes for zeroing the
Dimitry Andric [Sat, 17 Dec 2011 13:14:44 +0000 (13:14 +0000)]
In usr.bin/csup/auth.c, use the correct number of bytes for zeroing the
shared secret, and use long long format to snprintf a time_t.

MFC after: 1 week

12 years agoIn contrib/bzip2/bzip2recover.c, use the correct printf length modifier
Dimitry Andric [Sat, 17 Dec 2011 12:52:58 +0000 (12:52 +0000)]
In contrib/bzip2/bzip2recover.c, use the correct printf length modifier
for unsigned long long.

MFC after: 1 week

12 years agoAdter r228571 unbreak architectures with strict alignment rules
Bjoern A. Zeeb [Sat, 17 Dec 2011 11:06:22 +0000 (11:06 +0000)]
Adter r228571 unbreak architectures with strict alignment rules
by copying rather than casting.

12 years agoRemove now redundant mac argument.
Bernhard Schmidt [Sat, 17 Dec 2011 10:32:31 +0000 (10:32 +0000)]
Remove now redundant mac argument.

Discussed with: adrian@

12 years agoFix some net80211 enum nits:
Bernhard Schmidt [Sat, 17 Dec 2011 10:23:17 +0000 (10:23 +0000)]
Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
  compiler warnings

Submitted by: arundel@

12 years agoFixed some of markup.
Ruslan Ermilov [Sat, 17 Dec 2011 06:57:35 +0000 (06:57 +0000)]
Fixed some of markup.

Reviewed by: jhb

12 years agoIn usr.bin/mt/mt.c, the c_code member of struct commands should really
Dimitry Andric [Sat, 17 Dec 2011 02:23:30 +0000 (02:23 +0000)]
In usr.bin/mt/mt.c, the c_code member of struct commands should really
be an unsigned long, since it will contain values of ioctl request
codes.  On 64-bit arches, these will not fit into an int.

MFC after: 1 week

12 years agoIn sbin/devd/devd.h, 'event_proc' and 'eps' are declared as structs. In
Dimitry Andric [Sat, 17 Dec 2011 01:54:51 +0000 (01:54 +0000)]
In sbin/devd/devd.h, 'event_proc' and 'eps' are declared as structs.  In
devd.hh, there are redeclared as classes.  Fix the inconsistency.

MFC after: 1 week

12 years agoDisable yet another clang warning when WARNS <= 3.
Dimitry Andric [Sat, 17 Dec 2011 01:51:12 +0000 (01:51 +0000)]
Disable yet another clang warning when WARNS <= 3.

MFC after: 1 week

12 years agoIn usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
Dimitry Andric [Sat, 17 Dec 2011 01:36:50 +0000 (01:36 +0000)]
In usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
volatile, otherwise the indirection will not be emitted.

MFC after: 1 week

12 years agoIn sbin/dhclient, since we know the size of the source strings anyway,
Dimitry Andric [Sat, 17 Dec 2011 01:29:46 +0000 (01:29 +0000)]
In sbin/dhclient, since we know the size of the source strings anyway,
we might as well use memcpy; strlcpy is really unnecessary here.

MFC after: 1 week

12 years agoIn sbin/dhclient, work around warnings about the size argument to
Dimitry Andric [Sat, 17 Dec 2011 01:19:07 +0000 (01:19 +0000)]
In sbin/dhclient, work around warnings about the size argument to
strlcpy appearing to be the size of the source buffer, instead of the
destination.

MFC after: 1 week

12 years agoUse both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
Dimitry Andric [Sat, 17 Dec 2011 00:54:09 +0000 (00:54 +0000)]
Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
disruptive to actually fix all the warnings, and the code hasn't been
maintained for several years.

MFC after: 1 week

12 years agoIn sbin/atm/atmconfig/diag.c, fix a few warnings about format strings
Dimitry Andric [Sat, 17 Dec 2011 00:26:45 +0000 (00:26 +0000)]
In sbin/atm/atmconfig/diag.c, fix a few warnings about format strings
not being literals.

MFC after: 1 week

12 years agoUse NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the
Dimitry Andric [Sat, 17 Dec 2011 00:14:40 +0000 (00:14 +0000)]
Use NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the
alignment warnings than using WARNS=3, and it also works for clang.

MFC after: 1 week

12 years agoAllow this to work on embedded systems without Open Firmware by making
Nathan Whitehorn [Fri, 16 Dec 2011 23:46:05 +0000 (23:46 +0000)]
Allow this to work on embedded systems without Open Firmware by making
lack of a /chosen non-fatal, and manually removing memory in use by the
kernel from the physical memory map.

Submitted by: rpaulo

12 years agoUse NO_WARRAY_BOUNDS for sbin/routed/rtquery.
Dimitry Andric [Fri, 16 Dec 2011 23:43:58 +0000 (23:43 +0000)]
Use NO_WARRAY_BOUNDS for sbin/routed/rtquery.

MFC after: 1 week

12 years agoAdd a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
Dimitry Andric [Fri, 16 Dec 2011 23:42:25 +0000 (23:42 +0000)]
Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
to selectively work around warnings in programs that don't use flexible
array members, but instead define arrays of length 1 at the end of the
struct, and then access those beyond their declared bounds.

MFC after: 1 week

12 years agoZero BSS on start, in case the ELF loader that started the kernel did not
Nathan Whitehorn [Fri, 16 Dec 2011 23:40:56 +0000 (23:40 +0000)]
Zero BSS on start, in case the ELF loader that started the kernel did not
do this for us. This can happen on some embedded systems.

Submitted by: rpaulo

12 years agoIn contrib/gperf/src/output.cc, use the correct printf length modifier
Dimitry Andric [Fri, 16 Dec 2011 23:15:11 +0000 (23:15 +0000)]
In contrib/gperf/src/output.cc, use the correct printf length modifier
for a ptrdiff_t.

MFC after: 1 week

12 years agoIn sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
Dimitry Andric [Fri, 16 Dec 2011 23:09:31 +0000 (23:09 +0000)]
In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
format warnings and conditional operators.  (See LLVM PR 11313 for more
information.)

MFC after: 1 week

12 years agoIn sbin/camcontrol/camcontrol.c, fix a few warnings about format strings
Dimitry Andric [Fri, 16 Dec 2011 22:35:19 +0000 (22:35 +0000)]
In sbin/camcontrol/camcontrol.c, fix a few warnings about format strings
not being literals.

MFC after: 1 week

12 years agoDefine YY_NO_INPUT when building libbinutils, to prevent warnings about
Dimitry Andric [Fri, 16 Dec 2011 22:19:13 +0000 (22:19 +0000)]
Define YY_NO_INPUT when building libbinutils, to prevent warnings about
unused input() functions emitted by lex.

MFC after: 1 week

12 years agoFix the incompatible enum conversions in libexec/ypxfr in another, more
Dimitry Andric [Fri, 16 Dec 2011 22:05:10 +0000 (22:05 +0000)]
Fix the incompatible enum conversions in libexec/ypxfr in another, more
messy way, so as to not disrupt other yp programs: just add casts to
convert the incompatible enums, as the numerical values are the same
(either by accident, design, or the phase of the moon at that time).

MFC after: 1 week

12 years agoRevert r228592, as the non-messy way of fixing ypxfr breaks other yp
Dimitry Andric [Fri, 16 Dec 2011 21:57:44 +0000 (21:57 +0000)]
Revert r228592, as the non-messy way of fixing ypxfr breaks other yp
programs (e.g. usr.sbin/rpc.yppasswdd).

Spotted by: np
MFC after: 1 week

12 years agoIn cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse
Dimitry Andric [Fri, 16 Dec 2011 21:48:09 +0000 (21:48 +0000)]
In cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse
snprintf tricks.

MFC after: 1 week