setvbuf.3: allocation is not "deferred" when size is zero

2017-07-28 Thread Scott Cheloha
Hi, This bit from setvbuf(3): The size parameter may be given as zero to obtain deferred optimal-size buffer allocation as usual. doesn't describe what's happening in setvbuf.c. When size is 0, fp->_fb.base is allocated immediately: /* * Find optimal I/O size for

Re: time(1): perror(3) -> err(3) and friends

2017-07-28 Thread Scott Cheloha
> On Jul 22, 2017, at 12:49 PM, Ingo Schwarze wrote: > > [...] > > * In main(), prefer "return" over exit(3). Any particular reason for this or is that just the style that people have settled on? And to be clear you're saying warn("whatever"); return 1; is

setvbuf.3: document possible allocation failure

2017-07-28 Thread Scott Cheloha
Hi, Unlikely to happen during normal use, but setvbuf(3) can fail to allocate your buffer: /* prog.c */ #include int main(int argc, char *argv[]) { if (setvbuf(stdout, NULL, _IOFBF, 0)) perror("setvbuf");

Re: [PATCH] Remove useless sys/sys/dkbad.h

2017-07-28 Thread Vadim Zhukov
2017-07-29 2:15 GMT+03:00 Андрей Болконский : > sorry. correct patch: > > 2017-07-28 23:52 GMT+03:00 Андрей Болконский : > >> This header not used since retire sparc. >> build amd64 is ok FWIW, I've tested this patch on amd64. It lacks

Re: [PATCH] Remove useless sys/sys/dkbad.h

2017-07-28 Thread Андрей Болконский
sorry. correct patch: 2017-07-28 23:52 GMT+03:00 Андрей Болконский : > This header not used since retire sparc. > build amd64 is ok > > > *diff -ruN src/sys/ddb/db_structinfo.c mysrc/sys/ddb/db_structinfo.c* > *--- src/sys/ddb/db_structinfo.c 2017-07-27

Re: libform remove extra parentheses

2017-07-28 Thread Mark Kettenis
> Date: Fri, 28 Jul 2017 20:45:10 + > From: Florian Obser > > same for libform as previous diff for mopd. > > OK? ok kettenis@ > diff --git frm_driver.c frm_driver.c > index de06cdaf8a4..0e8ca3b88a5 100644 > --- frm_driver.c > +++ frm_driver.c > @@ -1285,7 +1285,7 @@

Re: mopd: remove extra parentheses

2017-07-28 Thread Mark Kettenis
> Date: Fri, 28 Jul 2017 20:43:06 + > From: Florian Obser > > this silences > > cc -O2 -pipe -I/usr/src/usr.sbin/mopd/mopd -I/usr/src/usr.sbin/mopd/mopd/.. > -I/usr/src/usr.sbin/mopd/mopd/../common -Werror-implicit-function-declaration > -MD -MP -c

[PATCH] Remove useless sys/sys/dkbad.h

2017-07-28 Thread Андрей Болконский
This header not used since retire sparc. build amd64 is ok *diff -ruN src/sys/ddb/db_structinfo.c mysrc/sys/ddb/db_structinfo.c* *--- src/sys/ddb/db_structinfo.c 2017-07-27 23:55:18.744698016 +0300* *+++ mysrc/sys/ddb/db_structinfo.c 2017-07-28 00:36:10.241963162 +0300* *@@ -1,5 +1,6 @@* * /*

libform remove extra parentheses

2017-07-28 Thread Florian Obser
same for libform as previous diff for mopd. OK? diff --git frm_driver.c frm_driver.c index de06cdaf8a4..0e8ca3b88a5 100644 --- frm_driver.c +++ frm_driver.c @@ -1285,7 +1285,7 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts) if (form->status & _POSTED) { -

mopd: remove extra parentheses

2017-07-28 Thread Florian Obser
this silences cc -O2 -pipe -I/usr/src/usr.sbin/mopd/mopd -I/usr/src/usr.sbin/mopd/mopd/.. -I/usr/src/usr.sbin/mopd/mopd/../common -Werror-implicit-function-declaration -MD -MP -c /usr/src/usr.sbin/mopd/mopd/process.c /usr/src/usr.sbin/mopd/mopd/process.c:139:17: warning: equality comparison

Re: rtisvalid in ip_output for NFS porters

2017-07-28 Thread Christian Weisgerber
Martin Pieuchot: > The second one has been found by Matthias Pitzl and fixed this week > by bluhm@: em(4) was reporting incorrect link state. This link state > being applied to the corresponding routes, rtisvalid() would refuse > to use the selected route which would break some NFS setups. > >

Re: amd(8): plog format string should be literal

2017-07-28 Thread Florian Obser
On Fri, Jul 28, 2017 at 09:34:29PM +0200, Frederic Cambus wrote: > Hi tech@, > > plog format string should be literal. > > Comments? OK? OK while you are in there, can you add format attributes to plog like our log.h has (see usr.sbin/bgpd/log.h for example) > > Index:

amd(8): plog format string should be literal

2017-07-28 Thread Frederic Cambus
Hi tech@, plog format string should be literal. Comments? OK? Index: usr.sbin/amd/amd/ifs_ops.c === RCS file: /cvs/src/usr.sbin/amd/amd/ifs_ops.c,v retrieving revision 1.5 diff -u -p -r1.5 ifs_ops.c --- usr.sbin/amd/amd/ifs_ops.c

Re: printf(3) return value on ENOMEM

2017-07-28 Thread Todd C. Miller
I just want to point out that we already return -1 for mmap allocation failures in the positional argument code. - todd

systat: return for non-void function

2017-07-28 Thread Florian Obser
pointed out by clang OK? diff --git pool.c pool.c index b6691ae0da6..3b289446522 100644 --- pool.c +++ pool.c @@ -496,6 +496,7 @@ unalloc: pc = _caches[--i]; free(pc->cache_cpus); } + return (-1); } void -- I'm not entirely sure you are real.

Re: TCP support for snmpd(8)

2017-07-28 Thread Marco Pfatschbacher
New diff, which a) deals with ENFILE b) fixes an embarrassing bug for IPv6 accepts Any OKs? Index: parse.y === RCS file: /cvs/src/usr.sbin/snmpd/parse.y,v retrieving revision 1.43 diff -u -p -p -u -r1.43 parse.y --- parse.y 5

Re: snmpd: format string for yyerror

2017-07-28 Thread Claudio Jeker
On Fri, Jul 28, 2017 at 12:36:22PM +, Florian Obser wrote: > not really a problem, errstr are just various static strings, but still... > > pointed out by clang, OK? OK claudio@ > diff --git snmpd/parse.y snmpd/parse.y > index efd1159c3ab..cc3d4194556 100644 > --- snmpd/parse.y > +++

Re: route6d: use correct size for strlcat

2017-07-28 Thread Claudio Jeker
On Fri, Jul 28, 2017 at 12:34:25PM +, Florian Obser wrote: > > clang... > > OK? OK claudio@ > diff --git route6d/log.c route6d/log.c > index 3dd3aefe558..efaba6900e5 100644 > --- route6d/log.c > +++ route6d/log.c > @@ -93,7 +93,7 @@ vlog(int pri, const char *fmt, va_list ap) > >

Re: dvmrpctl: remove unused variable

2017-07-28 Thread Claudio Jeker
On Fri, Jul 28, 2017 at 12:27:15PM +, Florian Obser wrote: > ... pointed out by clang > > OK? OK claudio@ > > > diff --git dvmrpctl/parser.c dvmrpctl/parser.c > index ffbf7c05a1e..17ec5fbb33a 100644 > --- dvmrpctl/parser.c > +++ dvmrpctl/parser.c > @@ -54,7 +54,6 @@ static const struct

Re: ripctl: remove unused variables

2017-07-28 Thread Claudio Jeker
On Fri, Jul 28, 2017 at 12:32:56PM +, Florian Obser wrote: > > clang... > > OK? OK claudio@ > > diff --git ripctl/parser.c ripctl/parser.c > index e82045f0eb7..08a7e88e71a 100644 > --- ripctl/parser.c > +++ ripctl/parser.c > @@ -54,8 +54,6 @@ static const struct token t_main[]; > static

[patch/route] Automatically choose default route AF

2017-07-28 Thread Denis Fondras
Hello, Here is a patch to route(8) to automatically choose the right address family when adding a default route using the "default" keyword. Index: route.8 === RCS file: /cvs/src/sbin/route/route.8,v retrieving revision 1.79 diff -u

Re: route6d: use correct size for strlcat

2017-07-28 Thread Mark Kettenis
> Date: Fri, 28 Jul 2017 12:34:25 + > From: Florian Obser > > clang... > > OK? ok kettenis@ > diff --git route6d/log.c route6d/log.c > index 3dd3aefe558..efaba6900e5 100644 > --- route6d/log.c > +++ route6d/log.c > @@ -93,7 +93,7 @@ vlog(int pri, const char *fmt,

Re: dvmrpctl: remove unused variable

2017-07-28 Thread Mark Kettenis
> Date: Fri, 28 Jul 2017 12:27:15 + > From: Florian Obser > > ... pointed out by clang > > OK? ok kettenis@ > diff --git dvmrpctl/parser.c dvmrpctl/parser.c > index ffbf7c05a1e..17ec5fbb33a 100644 > --- dvmrpctl/parser.c > +++ dvmrpctl/parser.c > @@ -54,7 +54,6 @@

Re: ripctl: remove unused variables

2017-07-28 Thread Mark Kettenis
> Date: Fri, 28 Jul 2017 12:32:56 + > From: Florian Obser > > clang... > > OK? ok kettenis@ > diff --git ripctl/parser.c ripctl/parser.c > index e82045f0eb7..08a7e88e71a 100644 > --- ripctl/parser.c > +++ ripctl/parser.c > @@ -54,8 +54,6 @@ static const struct token

Re: snmpd: format string for yyerror

2017-07-28 Thread Gerhard Roth
On Fri, 28 Jul 2017 12:36:22 + Florian Obser wrote: > not really a problem, errstr are just various static strings, but still... > > pointed out by clang, OK? > > diff --git snmpd/parse.y snmpd/parse.y > index efd1159c3ab..cc3d4194556 100644 > --- snmpd/parse.y > +++

Re: snmpd: engine id is just a binary string?

2017-07-28 Thread Gerhard Roth
On Fri, 28 Jul 2017 12:39:48 + Florian Obser wrote: > Not sure about this one, a quick glance at RFC 3411 suggests this > is just a binary string, so uint8_t is more appropriate. > > Any snmp nerds around? > > clang complained about this: > >

Re: ldapd: one negation is enough

2017-07-28 Thread Gleydson Soares
Florian Obser writes: > this made my head hurt, pointed out by clang. > > "logical not is only applied to the left hand side of this comparison > [-Wlogical-not-parentheses]" > > OK? oh I realized I had forgotten something, I've this change in my tree for months and ok'ed

snmpd: engine id is just a binary string?

2017-07-28 Thread Florian Obser
Not sure about this one, a quick glance at RFC 3411 suggests this is just a binary string, so uint8_t is more appropriate. Any snmp nerds around? clang complained about this: /usr/src/usr.sbin/snmpd/snmpd.c:349:47: warning: implicit conversion from 'int' to 'char' changes value from 128 to

snmpd: format string for yyerror

2017-07-28 Thread Florian Obser
not really a problem, errstr are just various static strings, but still... pointed out by clang, OK? diff --git snmpd/parse.y snmpd/parse.y index efd1159c3ab..cc3d4194556 100644 --- snmpd/parse.y +++ snmpd/parse.y @@ -273,14 +273,14 @@ main : LISTEN ON STRING {

route6d: use correct size for strlcat

2017-07-28 Thread Florian Obser
clang... OK? diff --git route6d/log.c route6d/log.c index 3dd3aefe558..efaba6900e5 100644 --- route6d/log.c +++ route6d/log.c @@ -93,7 +93,7 @@ vlog(int pri, const char *fmt, va_list ap) (void)vsnprintf(tmpbuf, sizeof(tmpbuf), fmt, ap); (void)strlcpy(logbuf, logqueue,

ripctl: remove unused variables

2017-07-28 Thread Florian Obser
clang... OK? diff --git ripctl/parser.c ripctl/parser.c index e82045f0eb7..08a7e88e71a 100644 --- ripctl/parser.c +++ ripctl/parser.c @@ -54,8 +54,6 @@ static const struct token t_main[]; static const struct token t_fib[]; static const struct token t_show[]; static const struct token

mtrace: are you still running mrouted 3.6 on little-endian machines?

2017-07-28 Thread Florian Obser
this can probably go. I wandered in there because clang says: /usr/src/usr.sbin/mtrace/mtrace.c:949:12: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value] if (*s || abs(ntohl(n->tr_vifout) - ntohl(p->tr_vifout)) > 10) {

ldapd: one negation is enough

2017-07-28 Thread Florian Obser
this made my head hurt, pointed out by clang. "logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]" OK? diff --git ldapd/modify.c ldapd/modify.c index f5d9007faaa..485d0fcfba9 100644 --- ldapd/modify.c +++ ldapd/modify.c @@ -132,7 +132,7 @@

dvmrpctl: remove unused variable

2017-07-28 Thread Florian Obser
... pointed out by clang OK? diff --git dvmrpctl/parser.c dvmrpctl/parser.c index ffbf7c05a1e..17ec5fbb33a 100644 --- dvmrpctl/parser.c +++ dvmrpctl/parser.c @@ -54,7 +54,6 @@ static const struct token t_show_iface[]; static const struct token t_show_nbr[]; static const struct token

Re: nsd: prototypes for __b64_pton and __b64_ntop

2017-07-28 Thread Mark Kettenis
> Date: Thu, 27 Jul 2017 19:50:26 + > From: Florian Obser > > ... to silence clang warnings, it kinda has a point... > > e.g.: > > /usr/src/usr.sbin/nsd/zonec.c:642:6: warning: implicit declaration of > function > '__b64_pton' is invalid in C99

Re: less(1) - segmentation fault with '-g'

2017-07-28 Thread Anton Lindqvist
On Fri, Jul 28, 2017 at 01:19:39PM +0200, Theo Buehler wrote: > On Thu, Jul 27, 2017 at 10:31:51AM +0100, Larry Hynes wrote: > > Hi > > > > $ env | grep LESS > > LESSHISTFILE=- > > LESS="-i -M -R -g -c" > > LESSCHARSET=utf-8 > > > > $ unset LESS > > $ unset LESSCHARSET > > $ unset LESSHISTFILE >

Re: less(1) - segmentation fault with '-g'

2017-07-28 Thread Theo Buehler
On Thu, Jul 27, 2017 at 10:31:51AM +0100, Larry Hynes wrote: > Hi > > $ env | grep LESS > LESSHISTFILE=- > LESS="-i -M -R -g -c" > LESSCHARSET=utf-8 > > $ unset LESS > $ unset LESSCHARSET > $ unset LESSHISTFILE > > $ LESS="-g" > $ echo 'foo\nbar\nfoo\nbar\nfoo\nbar' | less > > While in less,

rtisvalid in ip_output for NFS porters

2017-07-28 Thread Martin Pieuchot
I proposed this changed in 2015 and sadly it exposed two bugs at that time. The first one has been found and fixed during g2k16: a default route was referencing a stale ifa and considered invalid by rtisvalid(). The second one has been found by Matthias Pitzl and fixed this week by bluhm@: em(4)

Re: don't error when switch ioctls return EEXIST

2017-07-28 Thread Reyk Floeter
On Fri, Jul 28, 2017 at 06:13:50PM +1000, Jonathan Gray wrote: > The handling of 'add' used by bridge and switch in ifconfig does not > error out if the ioctl returns EEXIST. Do the same for the switch > specific 'addlocal' and 'portno' ioctls so netstart won't error out > when rerun with the

don't error when switch ioctls return EEXIST

2017-07-28 Thread Jonathan Gray
The handling of 'add' used by bridge and switch in ifconfig does not error out if the ioctl returns EEXIST. Do the same for the switch specific 'addlocal' and 'portno' ioctls so netstart won't error out when rerun with the same settings in hostname.switchN. Index: brconfig.c

Re: netstat: uint32_t is never < 0

2017-07-28 Thread Claudio Jeker
On Thu, Jul 27, 2017 at 07:48:24PM +, Florian Obser wrote: > /usr/src/usr.bin/netstat/inet.c:342:19: warning: comparison of unsigned > expression < 0 is always false [-Wtautological-compare] > if (kf->t_state < 0 || kf->t_state >= TCP_NSTATES) >