Re: Add sizes for free() in the AMD PowerNow! K8 driver

2017-12-08 Thread Stuart Henderson
Ok. As you probably already saw, the similar i386 files already have this. On 8 December 2017 17:54:51 Frederic Cambus wrote: Hi tech@, Add sizes for free() in the AMD PowerNow! K8 driver. Comments? OK? Index: sys/arch/amd64/amd64/powernow-k8.c

Re: grep(1) -m support

2017-12-08 Thread Paul Irofti
On Fri, Dec 08, 2017 at 03:23:02PM -0700, Theo de Raadt wrote: > > Here is a new diff that supports 0 and negative m values. > > I am very unsure about negative values. > > In posix you have > >-m-1 > and >-m -1 > > And you'll observe the latter doesn't work like you think it should.

Re: grep(1) -m support

2017-12-08 Thread Theo de Raadt
> Here is a new diff that supports 0 and negative m values. I am very unsure about negative values. In posix you have -m-1 and -m -1 And you'll observe the latter doesn't work like you think it should.

Re: grep(1) -m support

2017-12-08 Thread Paul Irofti
On Fri, Dec 08, 2017 at 11:44:04PM +0200, Paul Irofti wrote: > On Fri, Dec 08, 2017 at 02:40:54PM -0700, Theo de Raadt wrote: > > > But it still sets the return code (which I think is wrong) > > > %-- > > > root@roslunar:~# echo foo > foo > > >

Re: grep(1) -m support

2017-12-08 Thread Paul Irofti
On Fri, Dec 08, 2017 at 02:40:54PM -0700, Theo de Raadt wrote: > > But it still sets the return code (which I think is wrong) > > %-- > > root@roslunar:~# echo foo > foo > > root@roslunar:~# grep -m0 foo foo > > root@roslunar:~# echo $? > > 1 > >

Re: sed: Fix up y command

2017-12-08 Thread Todd C. Miller
On Thu, 07 Dec 2017 15:59:16 +0100, Martijn van Duren wrote: > Our sed command goes a bit bit bonkers on the y command in a couple of > different scenarios and was found thanks to the sed.1 diff from kshe. > > 1) is a posix[0] violation, which states: > If a followed by an 'n' appear in

Re: grep(1) -m support

2017-12-08 Thread Theo de Raadt
> But it still sets the return code (which I think is wrong) > %-- > root@roslunar:~# echo foo > foo > root@roslunar:~# grep -m0 foo foo > root@roslunar:~# echo $? > 1 > root@roslunar:~# grep -m5 foo foo > foo > root@roslunar:~# echo $?

Re: grep(1) -m support

2017-12-08 Thread Paul Irofti
On Fri, Dec 08, 2017 at 02:36:47PM -0700, Theo de Raadt wrote: > > root@roslunar:~# grep -m0 foo foo > > It looks like it returns 0 lines of the output. > > I believe -m0 should work right. It is the kind of situation > I expect would occur in scripts. But it still sets the return code (which

Re: grep(1) -m support

2017-12-08 Thread Theo de Raadt
> root@roslunar:~# grep -m0 foo foo It looks like it returns 0 lines of the output. I believe -m0 should work right. It is the kind of situation I expect would occur in scripts.

Re: grep(1) -m support

2017-12-08 Thread Paul Irofti
On Thu, Dec 07, 2017 at 11:23:51AM -0700, Theo de Raadt wrote: > seems fairly simple to me, but a few comments > > - Could mflag be removed and replaced by overloading mcount = -1 > as the no -m condition > > - What do other systems do with "-m 0" GNU grep is kind of random

iwm: fix wrong channel after scan

2017-12-08 Thread Stefan Sperling
This closes a race where the current BSS channel is set to whichever channel the most recent frame was received on. For instance, after a background scan, we might receive a few more frames from the AP we are going to leave, even after we have recorded our new AP's channel in ic_bss. Any such

Add sizes for free() in the AMD PowerNow! K8 driver

2017-12-08 Thread Frederic Cambus
Hi tech@, Add sizes for free() in the AMD PowerNow! K8 driver. Comments? OK? Index: sys/arch/amd64/amd64/powernow-k8.c === RCS file: /cvs/src/sys/arch/amd64/amd64/powernow-k8.c,v retrieving revision 1.26 diff -u -p -r1.26

Re: sb_flags vs sb_flagsintr

2017-12-08 Thread Alexander Bluhm
On Thu, Dec 07, 2017 at 01:37:15PM +0100, Martin Pieuchot wrote: > Right, updated diff below. OK bluhm@ > Index: kern/uipc_socket.c > === > RCS file: /cvs/src/sys/kern/uipc_socket.c,v > retrieving revision 1.209 > diff -u -p -r1.209

Re: sed: Fix read/write file not optional

2017-12-08 Thread Todd C. Miller
On Fri, 08 Dec 2017 07:31:25 +0100, Martijn van Duren wrote: > But you're right, although I would call it a bug more than a problem, > since this scenario would most likely never occur. Below is a revised > diff. This invalidates p, by turning it into a NUL. This is safe since > duptoeol also

net/rtsock.c: size to free(9)

2017-12-08 Thread kshe
Hi, I noticed one instance where the size given to free(9) can easily be determined. While here, this diff also removes an outdated comment (since r1.230) as well as a dead initialisation in rtm_addr(). Index: src/sys/net/rtsock.c

fstat(1): fix misaligned headers

2017-12-08 Thread kshe
Hi, Last time a new field was added, headers were not adjusted to account for the extra column in the output. Index: fstat.c === RCS file: /cvs/src/usr.bin/fstat/fstat.c,v retrieving revision 1.90 diff -u -p -r1.90 fstat.c ---

dc(1): always use bn_checkp()

2017-12-08 Thread kshe
Hi, This is the only instance where a manual check is made instead of calling bn_checkp(). Index: mem.c === RCS file: /cvs/src/usr.bin/dc/mem.c,v retrieving revision 1.7 diff -u -p -r1.7 mem.c --- mem.c 16 Feb 2015 20:53:34

dc(1): small cleanups

2017-12-08 Thread kshe
Hi, This patch includes the following minor changes: 1. Remove the `__inline' markers from functions that are only called from the jump table (I would actually like to remove them all as they are both ugly and utterly useless, but that would yield a much larger diff). 2. Make bexp() slightly

dc(1): recycle numbers

2017-12-08 Thread kshe
Hi, Basic arithmetic on relatively small numbers can be made much cheaper by leveraging BN_add(3), BN_sub(3) and BN_mul(3)'s ability to store the calculation's result in one of their operands, thus reducing allocation overhead. For example, with this simplification, incrementing a counter

Remove unnecessary includes (i386 VIA PadLock driver)

2017-12-08 Thread Frederic Cambus
Hi tech@, This diff remove unnecessary includes in the i386 version of the VIA PadLock driver. Comments? OK? Index: sys/arch/i386/i386/via.c === RCS file: /cvs/src/sys/arch/i386/i386/via.c,v retrieving revision 1.37 diff -u -p