Re: ntpd: strptime portability problem

2016-03-04 Thread busterb
Ok bcook@ > On Mar 4, 2016, at 4:32 PM, Christian Weisgerber wrote: > > Matthias Andree noticed that the constraint > offset was always off by 3600 seconds for him (running OpenNTPD on > FreeBSD with CET timezone). > > The way we parse the HTTP date in

Re: cp -i might violate POSIX

2016-03-04 Thread Timo Buhrmester
On Sat, Mar 05, 2016 at 03:03:36AM +0100, Dmitrij D. Czarkoff wrote: > So the goal of the diff is to replace something like > > $ for src in ${files}; do [ -r "$src" ] && cp ${src} dst/; done > > with > > $ yes n | cp -i ${files} dst/ > > ? Or alternatively, to state in the manual that -i

Re: cp -i might violate POSIX

2016-03-04 Thread Dmitrij D. Czarkoff
Timo Buhrmester said: > On Sat, Mar 05, 2016 at 02:39:41AM +0100, Dmitrij D. Czarkoff wrote: > > > This breaks doing something along the lines of ``yes n | cp -i [...]'' > > > > Why would anyone want that? > > To simulate what in FreeBSD's and GNU's implementation of cp is the > -n option, i.e.

Re: [ksh] [patch] Make "$@" and "$*" POSIX-compliant with 'set -u'

2016-03-04 Thread Dmitrij D. Czarkoff
Martijn Dekker said: > Martijn Dekker schreef op 04-03-16 om 16:21: > > I've also attached a simple regression test. I didn't know what existing > > .t file that would fit in, so I made a new one. > > Perhaps it should be added to obsd-regress.t -- it seems to have all the > miscellaneous tests

Re: cp -i might violate POSIX

2016-03-04 Thread Dmitrij D. Czarkoff
Timo Buhrmester said: > From src/bin/cp/cp.c: > > while ((ch = getopt(argc, argv, "HLNPRfailprv")) != -1) > > [...] > > case 'i': > > iflag = isatty(fileno(stdin)); > The -i in cp -i is ignored if standard input isn't a tty. > > This breaks doing

cp -i might violate POSIX

2016-03-04 Thread Timo Buhrmester
>From src/bin/cp/cp.c: > while ((ch = getopt(argc, argv, "HLNPRfailprv")) != -1) > [...] > case 'i': > iflag = isatty(fileno(stdin)); The -i in cp -i is ignored if standard input isn't a tty. This breaks doing something along the lines of

Re: [ksh] [patch] Make command -v and command -p[vV] POSIX compliant

2016-03-04 Thread Martijn Dekker
Martijn Dekker schreef op 04-03-16 om 22:46: > Martijn Dekker schreef op 04-03-16 om 19:30: >> Some minor updates to the man page are also needed. I'll make a new patch. > Here's take 2. It was correctly pointed out that I made some unrelated edits to sh.1 that would be better submitted and

Re: ntpd: strptime portability problem

2016-03-04 Thread Giovanni Bechis
On Fri, Mar 04, 2016 at 11:32:51PM +0100, Christian Weisgerber wrote: > Matthias Andree noticed that the constraint > offset was always off by 3600 seconds for him (running OpenNTPD on > FreeBSD with CET timezone). > > The way we parse the HTTP date in the ntpd constraint

Re: landisk: invalidate the entire cache on EMODE CPUs

2016-03-04 Thread Miod Vallat
> SH4 CPUs with EMODE bit set have a cache twice as big. Fix the obvious > copy mistake. There is nothing to fix in these routines. When EMODE is enabled, the cache becomes two way, instead of one way, which is why it becomes twice as big. sh4_emode_icache_sync_all() and

ntpd: strptime portability problem

2016-03-04 Thread Christian Weisgerber
Matthias Andree noticed that the constraint offset was always off by 3600 seconds for him (running OpenNTPD on FreeBSD with CET timezone). The way we parse the HTTP date in the ntpd constraint code isn't portable: if (strptime(p, "%a, %d %h %Y %T %Z",

Re: prefer memset() over bzero() for ber.c in snmpd and ypldap

2016-03-04 Thread Stuart Henderson
On 2016/03/04 16:40, Rob Pierce wrote: > A similar change was done to ber.c in ldapd by @mmcc. > > I just copied those changes for snmpd and ypldap. > > No binary change. ok sthen@

Re: [ksh] [patch] Make command -v and command -p[vV] POSIX compliant

2016-03-04 Thread Martijn Dekker
Martijn Dekker schreef op 04-03-16 om 19:30: > Todd C. Miller schreef op 04-03-16 om 19:22: >> This also looks fine but we should add a similar regress for whence's >> -p and -v flags. > > Some minor updates to the man page are also needed. I'll make a new patch. Here's take 2. I had missed one

prefer memset() over bzero() for ber.c in snmpd and ypldap

2016-03-04 Thread Rob Pierce
A similar change was done to ber.c in ldapd by @mmcc. I just copied those changes for snmpd and ypldap. No binary change. Regards, Index: snmpd/ber.c === RCS file: /cvs/src/usr.sbin/snmpd/ber.c,v retrieving revision 1.30 diff -u

sdhc: don't always compile the pci attachment driver

2016-03-04 Thread Patrick Wildt
Hi, if you attach sdhc, you automatically compile the pci attachment driver, even if there's no "sdhc* at pci?" in the config. This might fail on architectures that don't have pci compiled in. If I'm not completely mistaken, this can be averted by making the file depend on sdhc_pci. Tested to

Re: arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 02:35:34PM -0500, Brandon Mercer wrote: > On Fri, Mar 04, 2016 at 08:08:36PM +0100, Patrick Wildt wrote: > > On Fri, Mar 04, 2016 at 09:38:18AM -0500, Brandon Mercer wrote: > > > On Fri, Mar 04, 2016 at 03:15:23PM +0100, Patrick Wildt wrote: > > > > Hi, > > > > > > > >

Re: [file] file -i doesn't detect epub correctly

2016-03-04 Thread Nicholas Marriott
The only thing I see that we do not support is the indirect on the last line, I suggest just commenting it. On Fri, Mar 04, 2016 at 07:01:57PM +, Stuart Henderson wrote: > On 2016/03/04 19:50, Dmitrij D. Czarkoff wrote: > > Jiri B said: > > > file -i *.epub returns

Re: arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Brandon Mercer
On Fri, Mar 04, 2016 at 08:08:36PM +0100, Patrick Wildt wrote: > On Fri, Mar 04, 2016 at 09:38:18AM -0500, Brandon Mercer wrote: > > On Fri, Mar 04, 2016 at 03:15:23PM +0100, Patrick Wildt wrote: > > > Hi, > > > > > > this diff makes armv7 map the FDT, if available, and uses it to read > > >

Re: arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 09:38:18AM -0500, Brandon Mercer wrote: > On Fri, Mar 04, 2016 at 03:15:23PM +0100, Patrick Wildt wrote: > > Hi, > > > > this diff makes armv7 map the FDT, if available, and uses it to read > > information about the machine's available memory and bootargs. > > > > I'd

Re: [file] file -i doesn't detect epub correctly

2016-03-04 Thread Stuart Henderson
On 2016/03/04 19:50, Dmitrij D. Czarkoff wrote: > Jiri B said: > > file -i *.epub returns 'application/x-not-regular-file' or 'application/zip' > > and it should return 'application/epub+zip' (at least this is on Fedora). > > Below comes the patch that changes the way zip archives are treated in

Re: [file] file -i doesn't detect epub correctly

2016-03-04 Thread Dmitrij D. Czarkoff
Jiri B said: > file -i *.epub returns 'application/x-not-regular-file' or 'application/zip' > and it should return 'application/epub+zip' (at least this is on Fedora). Below comes the patch that changes the way zip archives are treated in magic file: 1. Immediately write "Zip archive data" for

Re: [ksh] [patch] Make command -v and command -p[vV] POSIX compliant

2016-03-04 Thread Martijn Dekker
Todd C. Miller schreef op 04-03-16 om 19:22: > This also looks fine but we should add a similar regress for whence's > -p and -v flags. Some minor updates to the man page are also needed. I'll make a new patch. - M.

Re: [ksh] [patch] Make "$@" and "$*" POSIX-compliant with 'set -u'

2016-03-04 Thread Martijn Dekker
Martijn Dekker schreef op 04-03-16 om 16:21: > I've also attached a simple regression test. I didn't know what existing > .t file that would fit in, so I made a new one. Perhaps it should be added to obsd-regress.t -- it seems to have all the miscellaneous tests added for OpenBSD. - M.

Re: [ksh] [patch] Make command -v and command -p[vV] POSIX compliant

2016-03-04 Thread Todd C. Miller
On Fri, 04 Mar 2016 18:05:39 +0100, Martijn Dekker wrote: > This simple patch makes the 'command' builtin POSIX-compliant and > consistent with other current shells. It fixes two things: > >a) 'command -v' does not find shell reserved words (a.k.a. keywords). > For instance, 'command -v

Re: [ksh] [patch] Make "$@" and "$*" POSIX-compliant with 'set -u'

2016-03-04 Thread Todd C. Miller
On Fri, 04 Mar 2016 16:21:37 +0100, Martijn Dekker wrote: > Here is another patch related to "$@" and "$*". It makes their behaviour > in combination with 'set -u' (set -o nounset) POSIX-compliant and > consistent with other current shells. > > As of 2009, POSIX mandates that the special

sys_process.c: remove relebad

2016-03-04 Thread Michal Mazurek
relebad used to have more body: relebad: PRELE(t); return (error); But then PRELE(t); was removed. This diff gets rid of what remains of relebad. Index: sys/kern/sys_process.c === RCS file:

Re: landisk: match function declaration

2016-03-04 Thread Christian Weisgerber
On 2016-03-04, Tobias Ulmer wrote: > Match function declaration, use void Yes, please. There is quite a bit of this in the MD parts of the tree. Since you are already in sh... $ grep -R '^[A-Za-z0-9_]*()' . ./dev/scif.c:scif_intr_init() ./sh/cache.c:sh_cache_init()

[ksh] [patch] Make "$@" and "$*" POSIX-compliant with 'set -u'

2016-03-04 Thread Martijn Dekker
Here is another patch related to "$@" and "$*". It makes their behaviour in combination with 'set -u' (set -o nounset) POSIX-compliant and consistent with other current shells. As of 2009, POSIX mandates that the special parameters "$@" and "$*" be exempt from 'set -u' checking. The reason is

typo in magic.5

2016-03-04 Thread Dmitrij D. Czarkoff
OK? -- Dmitrij D. Czarkoff Index: magic.5 === RCS file: /cvs/src/usr.bin/file/magic.5,v retrieving revision 1.14 diff -u -p -r1.14 magic.5 --- magic.5 15 Jul 2010 21:54:20 - 1.14 +++ magic.5 4 Mar 2016 15:13:06

Re: arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Brandon Mercer
On Fri, Mar 04, 2016 at 03:15:23PM +0100, Patrick Wildt wrote: > Hi, > > this diff makes armv7 map the FDT, if available, and uses it to read > information about the machine's available memory and bootargs. > > I'd like to get some opinions about the way I have implemented some > stuff. For

Re: arm: support Allwinner A20 Ethernet

2016-03-04 Thread Theo de Raadt
> On Fri, Mar 04, 2016 at 11:19:37AM -0300, Daniel Bolgheroni wrote: > > On Sat, Feb 27, 2016 at 11:09:10PM +0100, Patrick Wildt wrote: > > > > > > + /* print interrupt state */ > > > + snprintb(buf, sizeof(buf), "\177\20" > > > + "b\x10""NI\0" ... > > I don't have a quick solution for this

Re: arm: support Allwinner A20 Ethernet

2016-03-04 Thread Patrick Wildt
On Fri, Mar 04, 2016 at 11:19:37AM -0300, Daniel Bolgheroni wrote: > On Sat, Feb 27, 2016 at 11:09:10PM +0100, Patrick Wildt wrote: > > > > + /* print interrupt state */ > > + snprintb(buf, sizeof(buf), "\177\20" > > + "b\x10""NI\0" > > + "b\x0f""AI\0" > > + "b\x0e""ER\0" >

Re: arm: support Allwinner A20 Ethernet

2016-03-04 Thread Daniel Bolgheroni
On Sat, Feb 27, 2016 at 11:09:10PM +0100, Patrick Wildt wrote: > > + /* print interrupt state */ > + snprintb(buf, sizeof(buf), "\177\20" > + "b\x10""NI\0" > + "b\x0f""AI\0" > + "b\x0e""ER\0" > + "b\x0d""FB\0" > + "b\x0a""ET\0" > +

arm/fdt: map fdt and use given memory/bootargs

2016-03-04 Thread Patrick Wildt
Hi, this diff makes armv7 map the FDT, if available, and uses it to read information about the machine's available memory and bootargs. I'd like to get some opinions about the way I have implemented some stuff. For instance, I need the size of the FDT so I can properly copy it. Does it make

proc.h: fix comment

2016-03-04 Thread Michal Mazurek
After looking at dowait4() I believe this is a typo. Change space to a tab while here. Index: sys/sys/proc.h === RCS file: /cvs/src/sys/sys/proc.h,v retrieving revision 1.213 diff -u -p -r1.213 proc.h --- sys/sys/proc.h 6 Dec

Re: KASSERT() @ pf_test() is back

2016-03-04 Thread Alexandr Nedvedicky
Hello Stuart, thanks for testing it. I'll commit it today. regards sasha On Fri, Mar 04, 2016 at 01:08:42AM +, Stuart Henderson wrote: > On 2016/02/28 13:01, Martin Pieuchot wrote: > > On 08/02/16(Mon) 01:55, Alexandr Nedvedicky wrote: > > > Hello, > > > > > > I don't expect to see O.K. to

kern_proc.c: fix comment

2016-03-04 Thread Michal Mazurek
The argument was changed from 'proc *p' to 'process *pr' in 2010. Index: sys/kern/kern_proc.c === RCS file: /cvs/src/sys/kern/kern_proc.c,v retrieving revision 1.65 diff -u -p -r1.65 kern_proc.c --- sys/kern/kern_proc.c11

Re: [ksh] [patch] Make "$@" POSIX-compliant with empty IFS

2016-03-04 Thread Dmitrij D. Czarkoff
Martijn Dekker said: > So this patch makes quoted "$@" act according to the standard even when > IFS is empty. Quoted "$*" is unchanged. For the unspecified (not > standardised) cases of unquoted $@ and $*, this patch makes ksh act like > AT ksh93, bash, zsh and (d)ash, which seems safest from a >

landisk: invalidate the entire cache on EMODE CPUs

2016-03-04 Thread Tobias Ulmer
SH4 CPUs with EMODE bit set have a cache twice as big. Fix the obvious copy mistake. Didn't fix the problem I was looking at, but may help with general stability (I think all landisks use the EMODE capable SH7751R) My "good" landisk is happy with this. diff --git a/sys/arch/sh/sh/cache_sh4.c

landisk: match function declaration

2016-03-04 Thread Tobias Ulmer
Match function declaration, use void --- a/sys/arch/sh/sh/mmu_sh3.c +++ b/sys/arch/sh/sh/mmu_sh3.c @@ -38,7 +38,7 @@ #include void -sh3_mmu_start() +sh3_mmu_start(void) { /* Zero clear all TLB entry */ sh3_tlb_invalidate_all(); @@ -89,7 +89,7 @@ sh3_tlb_invalidate_asid(int

landisk: bus_dma.c cleanup

2016-03-04 Thread Tobias Ulmer
Found while debugging cache problems on landisk Remove mapstore and error, remnants of code logic long gone. DMAMAP_RESET is only used on landisk, disrupts readability and the one line saved per use doesn't really justify its existence to me --- a/sys/arch/landisk/landisk/bus_dma.c +++