fix(firewire): fix tcode switch fallthrough on little-endian
The break statements in fwohci_arcv_swap() were inside
#if BYTE_ORDER == BIG_ENDIAN guards, causing all cases to fall
through to the default "Unknown tcode" handler on little-endian
(x86) systems. This meant every received packet was dropped,
breaking bus manager election, split transactions, and all
asynchronous communication.
Move break statements outside the #if guards to match FreeBSD.
fix(syslogd): check f_prevline content instead of array address
f_prevline is a char[] struct member, so its address is always
non-NULL. Check f_prevline[0] to test whether the previous line
buffer contains a message, matching the existing check at line 1010.
fix(kcollect): mark unused total_count parameter in dump_influxdb()
total_count is required by the function pointer signature but not
used in the influxdb output path. Mark it __unused and remove the
dead ++total_count increment.
fix(iostat): remove unused tflag variable
tflag was set when -t was parsed but never checked; the -t option's
effect is handled entirely by buildmatch().
fix(vmstat): remove unused zfreecnt_prev in dozmem()
zfreecnt_prev was accumulated from saved per-cpu zone stats but
never displayed. Only znalloc_prev is used for the delta output.
fix(diff): remove unused jackpot counter in check()
The jackpot variable tracked hash collision false-matches but was
only referenced in a commented-out debug fprintf. Remove the variable,
its increment, and the dead comment block.
fix(growfs): remove unused dupper variable in updjcg()
dupper was computed from cgdmin() but never referenced in this
function. The other growfs functions that use dupper are unaffected.
fix(libfetch): remove unused base64 length counter in http_base64()
The 'r' variable tracked output length but was never returned or
used. The function returns the NUL-terminated string directly.
fix(monop): remove unused rnt variable in printsq()
The railroad rent was computed into 'rnt' but never used; the printf
already calculates the same value inline via 25 << (num_rr - 1).
fix(libkvm): return close() error status from kvm_close()
kvm_close() accumulated close() return values into 'error' via |=
but always returned 0, silently discarding close failures.
Return the accumulated error to match the function's int return type
and the kvm_close(3) manpage contract.
hammer2: fix HAMMER2IOC_RECLUSTER ioctl failing on local mounts
iroot->cluster.focus is lazily set during I/O via hammer2_cluster_resolve
and is NULL at mount time, causing HAMMER2IOC_RECLUSTER to always fail with
EINVAL and log a misleading "not a local device mount" message.
Use cluster->focus->hmp when focus is set (priority), falling back to
array[0].chain->hmp for single-chain clusters where focus has not yet
been resolved. Remove the spurious diagnostic kprintfs.
libnvmm: Revert unneeded '-Wdangling-pointer' #pragma diagnostic
The in-base GCC 12.5 does not give such warnings, so just revert this
unneeded #pragma hack added in commit
bdbecb468706b0d4afd30f9aeb119c342f6f4e29.
In addition, we don't really like such #pragma hacks all over the place;
better to identify the cause and fix the code or adjust the warning
flags to suppress false positives.
fix: iconv: move NULL checks before pointer arithmetic in iconvctl()
strchr() result was used in pointer arithmetic and incremented before
being checked for NULL. Move the guards above the strlcpy() call.
tcplay/cryptdisks: Suppress GCC 15 false-positive -Wmaybe-uninitialized.
GCC 15 cannot see that mem is always initialized after the
malloc NULL check. Use a guarded diagnostic pragma to suppress
the warning only on GCC >= 15.
various: Fix -Wstringop-overread and -Wdangling-pointer warnings.
Fix sizeof(&sum) vs sizeof(sum) bug in adventure save/restore.
Fix strcmp() on non-NUL-terminated fgetln() buffer in libfetch.
Suppress false positives in libefivar and libnvmm.
libc/rs: Fix use-after-free on realloc (-Wuse-after-free).
GCC 15 warns when pointer arithmetic references a pointer that was
passed to realloc(). Save the offset before the realloc call and
recompute the pointer from the new allocation afterwards.
various: Fix always-true/false address comparisons (-Waddress).
GCC 15 warns when comparing the address of a struct member against
NULL, since such addresses can never be NULL. Replace with emptiness
checks where intent was "is it set", remove dead guards otherwise.
Also fixes a latent bug in telnet ring.c where a pointer expression
was used as a boolean instead of as the RHS of a comparison.
various: Fix -Wunterminated-string-initialization warnings.
GCC 15 warns when a string literal exactly fills a char array,
truncating the NUL terminator. Extend arrays used as strings.
Use char array initializers for intentionally non-terminated arrays.
various: Swap transposed calloc() count/size arguments.
GCC 15 warns when calloc() is called with sizeof() as the first
argument and count as the second (-Wcalloc-transposed-args).
The correct prototype is calloc(count, size).
csh(1): Fix further warnings and bump WARNS from 1 to 6.
* Remove unneeded malloc_usable_size() prototype (there is one
in <stdlib.h>).
* ut_host is a member of struct utmpx, too, so expand the #ifdef for
the prototypes for utmphost() and utmphostsize() accordingly.
fix: tcsh: add missing exportpath() prototype to sh.decls.h
GCC 15 treats implicit function declarations as errors.
exportpath() is defined in sh.set.c but had no prototype,
causing a build failure with -Werror=implicit-function-declaration.