[PATCH] Use strcasestr(3) instead of nsearch()

2017-02-16 Thread Scott Cheloha
Hi, Unless I'm missing something more clever, in vacation.c, nsearch() is just a slower strcasestr(3). -- Scott Cheloha ? vacation Index: vacation.c === RCS file: /cvs/src/usr.bin/vacation/vacation.c,v retrieving revision 1.37 diff

Re: [PATCH] Use strcasestr(3) instead of nsearch()

2017-02-27 Thread Scott Cheloha
1 week bump. See prior mail for patch. Sorry if bumping your own patch is not kosher, this is my first patch. -- Scott Cheloha

Re: Add a "random" target to bsd.regress.mk

2017-03-22 Thread Scott Cheloha
> On Mar 22, 2017, at 11:47 AM, Alexander Bluhm wrote: > > I would not do all this work. I have indepentent targets for some > of my own tests that I use regualry for development. But for other > people's tests which just pass, I don't care. Making the individual >

Add a "random" target to bsd.regress.mk

2017-03-18 Thread Scott Cheloha
independence of each test case. Any takers? Thoughts? -- Scott Cheloha Index: share/man/man5/bsd.regress.mk.5 === RCS file: /cvs/src/share/man/man5/bsd.regress.mk.5,v retrieving revision 1.11 diff -u -p -r1.11 bsd.regress.mk.5 --- bsd.

Re: Add a "random" target to bsd.regress.mk

2017-03-20 Thread Scott Cheloha
means, but a start. Unless I misunderstood your question. -- Scott Cheloha

Re: Add a "random" target to bsd.regress.mk

2017-03-21 Thread Scott Cheloha
tests does not make > sense. I think you try to implement the second step before the first. > > Look at the tests and figure out wether you want to fix all > of them. I expect a lot of work. After this has happened, we could > add your target. Agreed, noted. -- Scott Cheloha

Better error output for readlink(1)

2017-04-04 Thread Scott Cheloha
lets us trivially report the myriad ways readlink(2) can fail. At the moment we just exit 1, which can be misleading during interactive use. While here, do other miscellaneous style(9)-type changes. Any takers? -- Scott Cheloha P.S. returning from main() is preferred over exit(3), right? Index

Re: Better error output for readlink(1)

2017-04-04 Thread Scott Cheloha
return 1; + } buf[n] = '\0'; } That way you still say nothing if the issue is, in fact, that your target isn't a symbolic link, but you point out any other errors. -- Scott Cheloha

Re: Better error output for readlink(1)

2017-04-05 Thread Scott Cheloha
> On Apr 5, 2017, at 2:48 AM, Nicholas Marriott wrote: > >> On Tue, Apr 04, 2017 at 05:03:26PM -0500, Scott Cheloha wrote: >> >> [...] >> >> In the current code, however, you could have insufficient permissions >> for a part of the path (EPERM), or an I

from: getline(3) can fail

2017-04-20 Thread Scott Cheloha
Check whether or not getline(3) failed before exiting. It also couldn't hurt to close fp... especially given that we're freeing line, too, right before exit. Thoughts? -- Scott Cheloha Index: from.c === RCS file: /cvs/src/usr.bin

Re: xinit(1): xdm(1) -> xenodm(1)

2017-04-23 Thread Scott Cheloha
> On Apr 23, 2017, at 2:44 AM, Jason McIntyre wrote: > > [...] but note that all this text is doing is giving an example of a > window manager and, as such, it's not wrong. My thinking is that preventing stuff like $ man xdm man: No entry for xdm in the manual.

dd: use monotonic clock for summary statistics

2017-08-12 Thread Scott Cheloha
bit of a roundabout sort of way. Feedback? -- Scott Cheloha Index: bin/dd/dd.c === RCS file: /cvs/src/bin/dd/dd.c,v retrieving revision 1.23 diff -u -p -r1.23 dd.c --- bin/dd/dd.c 9 Oct 2015 01:37:06 - 1.23 +++ bin/dd/dd.c 13 Aug 2017

Re: tetris: use monotonic clock for fall timeout

2017-08-12 Thread Scott Cheloha
1 week bump. -- Scott Cheloha > On Aug 5, 2017, at 8:25 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Hi, > > In tetris(6) we use gettimeofday(2) to determine (roughly) how > long we polled for user input. This then gets subtracted from > the time remain

tftp: use monotonic clock for statistics summary

2017-08-16 Thread Scott Cheloha
Hi, Same deal here as in dd(1). We display the elapsed time so we want a monotonic clock. -- Scott Cheloha Index: usr.bin/tftp/tftp.c === RCS file: /cvs/src/usr.bin/tftp/tftp.c,v retrieving revision 1.24 diff -u -p -r1.24 tftp.c

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

2017-07-13 Thread Scott Cheloha
We currently use a mix of perror(3) and err(3). In one case you can merge perror + exit into err, which is nice. The warns, though, are not equivalent (you get a "time: " prefix), so maybe this is too risky. Putting it out here anyway. -- Scott Cheloha Index: usr.bin/t

time(1): make global flags local

2017-07-13 Thread Scott Cheloha
The flags don't need to be global, and there are more obvious ways to zero a variable. While here, order the stack structures and variables by size. -- Scott Cheloha Index: usr.bin/time/time.c === RCS file: /cvs/src/usr.bin/time

time(1): kill some NOTREACHEDs

2017-07-13 Thread Scott Cheloha
style(9) says these can go. -- Scott Cheloha Index: usr.bin/time/time.c === RCS file: /cvs/src/usr.bin/time/time.c,v retrieving revision 1.22 diff -u -p -r1.22 time.c --- usr.bin/time/time.c 13 Jul 2017 06:39:54 - 1.22

time(1): kill some lint-era voids, switch to getprogname(3)

2017-07-13 Thread Scott Cheloha
The (void) casts are going out of style. While here, switch from __progname to getprogname(3) -- Scott Cheloha Index: usr.bin/time/time.c === RCS file: /cvs/src/usr.bin/time/time.c,v retrieving revision 1.22 diff -u -p -r1.22

lock(1): print secondary header only once on SIGINT, SIGQUIT

2017-07-08 Thread Scott Cheloha
handler when readpassphrase() hands us back a zero-length password, which indicates that the user just hit enter or sent an EOT. -- Scott Cheloha Index: usr.bin/lock/lock.c === RCS file: /cvs/src/usr.bin/lock/lock.c,v retrieving revision

grdc: fprintf(stderr -> warnx

2017-07-08 Thread Scott Cheloha
Just use warnx. -- Scott Cheloha Index: games/grdc/grdc.c === RCS file: /cvs/src/games/grdc/grdc.c,v retrieving revision 1.26 diff -u -p -r1.26 grdc.c --- games/grdc/grdc.c 7 Mar 2016 12:07:56 - 1.26 +++ games/grdc

lock(1): remove some ARGSUSEDs

2017-07-08 Thread Scott Cheloha
style(9) says it's okay to delete these. -- Scott Cheloha Index: usr.bin/lock/lock.c === RCS file: /cvs/src/usr.bin/lock/lock.c,v retrieving revision 1.34 diff -u -p -r1.34 lock.c --- usr.bin/lock/lock.c 3 May 2017 09:51:39 -

Re: grdc: fprintf(stderr -> warnx

2017-07-08 Thread Scott Cheloha
> On Jul 8, 2017, at 1:13 PM, Theo Buehler <t...@math.ethz.ch> wrote: > > On Sat, Jul 08, 2017 at 10:27:43AM -0500, Scott Cheloha wrote: >> Just use warnx. > > I don't have a real opinion on this one, but note that this changes > the output slightly. Are you wor

time(1): use monotonic clock for computing elapsed time

2017-07-12 Thread Scott Cheloha
without (perceptibly) changing the result in the typical case. Thoughts? Feedback? -- Scott Cheloha [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/time.html [2] http://gnats.netbsd.org/45592 Index: bin/csh/csh.h === RC

Re: time(1): use monotonic clock for computing elapsed time

2017-07-12 Thread Scott Cheloha
Whoops, prior diff for usr.bin/time/time.c has a dumb typo, corrected diff attached. -- Scott Cheloha Index: usr.bin/time/time.c === RCS file: /cvs/src/usr.bin/time/time.c,v retrieving revision 1.21 diff -u -p -r1.21 time.c

crypt_checkpass.3: mention additional failure case for crypt_newhash

2017-07-21 Thread Scott Cheloha
;, hash2, sizeof(hash2)) == -1) err(1, "crypt_newhash 2"); return 0; } Attached patch documents the case. -- Scott Cheloha Index: lib/libc/crypt/crypt_checkpass.3 === RCS file: /cvs/src/lib/libc/crypt

Re: time(1): use monotonic clock for computing elapsed time

2017-07-21 Thread Scott Cheloha
~1 week bump. Changes to time(1) were committed by tedu@. Any feedback on the ksh/csh portions of the patch? -- Scott Cheloha

style.9: discourage (void)ing unused return values

2017-07-21 Thread Scott Cheloha
the lines of, "this was mainly done to appease lint(1), but now that we don't ship lint(1) it only makes code harder to read." If so, it might fit in better down at the end of the document after the bit about not using lint-style comments. Thoughts? -- Scott Cheloha Index: share/man/ma

Re: style.9: discourage (void)ing unused return values

2017-07-22 Thread Scott Cheloha
> Date: Sat, 22 Jul 2017 15:29:17 +0200 > From: Ingo Schwarze <schwa...@usta.de> > > Hi Scott, > > Scott Cheloha wrote on Fri, Jul 21, 2017 at 05:03:11PM -0500: > >> Per encouragement from deraadt@, > > Not sure what exactly he said, but i'm quite sure y

Re: crypt_checkpass.3: mention additional failure case for crypt_newhash

2017-07-22 Thread Scott Cheloha
> On Jul 21, 2017, at 10:24 PM, Ted Unangst <t...@tedunangst.com> wrote: > > Scott Cheloha wrote: >> crypt_newhash(3) will return -1 and set errno to EINVAL if hashsize is >> too small to accommodate bcrypt's hash space. I imagine this would >> also be the case i

lock(1): report remaining time with getitimer(2)

2017-07-02 Thread Scott Cheloha
) directly. CC'd tedu@ because he's on the commit trail for lock.c within the last two years. Thoughts? -- Scott Cheloha Index: usr.bin/lock/lock.c === RCS file: /cvs/src/usr.bin/lock/lock.c,v retrieving revision 1.34 diff -u -p -r1.34

Re: lock(1): use crypt_checkpass(3) for one-off keys

2017-07-06 Thread Scott Cheloha
uld a later patch exposing something like, I dunno, "BCRYPT_HASHMAX" to includers of unistd.h be welcome? A documented define would round out the API. -- Scott Cheloha

xinit(1): xdm(1) -> xenodm(1)

2017-04-21 Thread Scott Cheloha
Index: xinit.man === RCS file: /cvs/xenocara/app/xinit/man/xinit.man,v retrieving revision 1.3 diff -u -p -r1.3 xinit.man --- xinit.man 30 Aug 2015 13:32:02 - 1.3 +++ xinit.man 21 Apr 2017 21:51:16 - @@ -44,7 +44,7 @@

Re: mg: print default choice before colon in echo line prompts

2017-08-05 Thread Scott Cheloha
1 week bump, any other feedback on this? -- Scott Cheloha > On Jul 30, 2017, at 2:05 AM, Florian Obser <flor...@narrans.de> wrote: > > OK florian@ > > [...]

tetris: use monotonic clock for fall timeout

2017-08-05 Thread Scott Cheloha
into poll(2). I've playtested a bit and it doesn't ~feel~ any different. If anything the game *should* feel less choppy under certain conditions, though I can't really prove that. Feedback? -- Scott Cheloha Index: games/tetris/input.c

mg: print default choice before colon in echo line prompts

2017-07-29 Thread Scott Cheloha
that case it's meant to evoke the utility of the same name. Feedback? -- Scott Cheloha Index: usr.bin/mg/buffer.c === RCS file: /cvs/src/usr.bin/mg/buffer.c,v retrieving revision 1.103 diff -u -p -r1.103 buffer.c --- usr.bin/mg/buffe

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

2017-07-28 Thread Scott Cheloha
whether it's important to mention that the allocation occurs immediately as opposed to whenever I/O is first attempted, so I've just pared the remark down. -- Scott Cheloha Index: lib/libc/stdio/setvbuf.3 === RCS file: /cvs/src/lib/libc/stdi

setvbuf.3: document possible allocation failure

2017-07-28 Thread Scott Cheloha
icular circumstances described? Or is it better to just write the standard line?, i.e. "Insufficient storage space is available." As a reader I would want to know more precisely how the interface can fail. Still seems kind of messy. Maybe my wording could be improved. -- Scott

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

2017-07-28 Thread Scott Cheloha
n("whatever"); return 1; is preferred over err(1, "whatever"); in main(). -- Scott Cheloha

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

2017-08-17 Thread Scott Cheloha
3 week bump. -- Scott Cheloha > On Jul 28, 2017, at 9:26 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Hi, > > This bit from setvbuf(3): > > The size parameter may be given as zero to obtain > deferred optimal-size buffer allocation as usual.

Re: setvbuf.3: document possible allocation failure

2017-08-17 Thread Scott Cheloha
3 week bump. -- Scott Cheloha > On Jul 28, 2017, at 8:33 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Hi, > > Unlikely to happen during normal use, but setvbuf(3) can fail > to allocate your buffer: > > /* prog.c */ > #include > >

Re: ksh.1: two typos

2017-08-17 Thread Scott Cheloha
> On Aug 17, 2017, at 7:47 PM, Theo Buehler <t...@theobuehler.org> wrote: > > On Fri, Aug 18, 2017 at 02:37:51AM +0200, Theo Buehler wrote: >> On Thu, Aug 17, 2017 at 07:25:14PM -0500, Scott Cheloha wrote: >>> Spotted these when customizing my prompt. >>>

ftp: use mono clock for transfer estimates, stats

2017-08-19 Thread Scott Cheloha
? -- Scott Cheloha Index: usr.bin/ftp/util.c === RCS file: /cvs/src/usr.bin/ftp/util.c,v retrieving revision 1.84 diff -u -p -r1.84 util.c --- usr.bin/ftp/util.c 21 Jan 2017 08:33:07 - 1.84 +++ usr.bin/ftp/util.c 19 Aug 2017 14:24

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

2017-08-20 Thread Scott Cheloha
Few weeks bump. Any feedback on this fabulous Scott Cheloha/ingo@ collaboration? Slightly re-tweaked patch below; while here: kill(getpid(), sig) -> raise(sig) I didn't even know there was a raise(3) function until this weekend, they really did think of everything. -- Scott Chel

lock(1): use crypt_checkpass(3) for one-off keys

2017-06-26 Thread Scott Cheloha
this works, but it feels off. _PASSWORD_LEN is meant to be an upper bound on length of the plaintext, not the hash output, right? Is there a better way to size my buffer for use with crypt_newhash(3)? -- Scott Cheloha Index: usr.bin/l

Re: from: getline(3) can fail

2017-05-28 Thread Scott Cheloha
1 month bump. CC'd millert@ because he made the switch to getline(3) in r1.18. Original message below. -- On Apr 20, 2017, at 8:59 PM, Scott Cheloha <scottchel...@gmail.com> wrote: Check whether or not getline(3) failed before exiting. It also couldn't hurt to close fp... especially

release(8): add command example to step 3 for sysmerge(8)/MAKEDEV(8)

2017-06-04 Thread Scott Cheloha
emphasize through example that MAKEDEV(8) makes device nodes in the current working directory? Am I missing something here? -- Scott Cheloha Index: share/man/man8/release.8 === RCS file: /cvs/src/share/man/man8/release.8,v retrieving rev

vscsi.4, wsdisplay.4: add missing Dv tags to ioctl constants

2017-09-11 Thread Scott Cheloha
splay_font Selects the font specified in the .Va name field. -- Scott Cheloha Index: share/man/man4/vscsi.4 === RCS file: /cvs/src/share/man/man4/vscsi.4,v retrieving revision 1.13 diff -u -p -r1.13 vscsi.4 --- share/man/man4/vscsi.4

mg: fgetln -> getline

2017-09-16 Thread Scott Cheloha
do_cscope() looked like a typo so I deleted the semicolon. I also noticed that there were no error checks after the read loops so I added an echo print on ferror(). I don't know if this is sufficient, but we weren't doing anything before, so it's a start. Thoughts? -- Scott Cheloha Index:

Re: pthread_once: don't deadlock on cancel from init_routine

2017-10-09 Thread Scott Cheloha
Hi, > On Oct 1, 2017, at 9:30 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Per this bit from pthread_once(3): > >> The function pthread_once() is not a cancellation point. >> However, if init_routine() is a cancellation point and is >> c

Re: tftp: use monotonic clock for statistics summary

2017-09-09 Thread Scott Cheloha
3 week bump. -- Scott Cheloha > On Aug 16, 2017, at 8:46 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Hi, > > Same deal here as in dd(1). We display the elapsed time so we want > a monotonic clock. > > -- > Scott Cheloh

Re: cdio: read_track: plug leak

2017-09-10 Thread Scott Cheloha
> On Sep 10, 2017, at 9:35 PM, Michael W. Bombardieri wrote: > > Patch was also posted here, but I didn't test it. > https://marc.info/?l=openbsd-tech=149784342025304=2 omg we're twins

Re: md5(1): use mono clock in time trial

2017-09-11 Thread Scott Cheloha
> On Sep 11, 2017, at 9:25 AM, Theo de Raadt <dera...@openbsd.org> wrote: > >> Scott Cheloha: >> >>> Use a monotonic clock for the elapsed time trial. >> >> FreeBSD uses getrusage() to fetch the user time used. I think that >> makes more sens

md5(1): use mono clock in time trial

2017-09-10 Thread Scott Cheloha
Hi, Use a monotonic clock for the elapsed time trial. -- Scott Cheloha Index: bin/md5/md5.c === RCS file: /cvs/src/bin/md5/md5.c,v retrieving revision 1.91 diff -u -p -r1.91 md5.c --- bin/md5/md5.c 22 May 2017 16:00:47 -

cdio: mono clock for progress printouts in rip, write

2017-09-10 Thread Scott Cheloha
Hi, This keeps the progress printouts from stalling in the pathological case. We were also missing for gettimeofday(2). -- Scott Cheloha Index: usr.bin/cdio/mmc.c === RCS file: /cvs/src/usr.bin/cdio/mmc.c,v retrieving revision

cdio: read_track: plug leak

2017-09-10 Thread Scott Cheloha
. Feedback? -- Scott Cheloha Index: usr.bin/cdio/rip.c === RCS file: /cvs/src/usr.bin/cdio/rip.c,v retrieving revision 1.16 diff -u -p -r1.16 rip.c --- usr.bin/cdio/rip.c 20 Aug 2015 22:32:41 - 1.16 +++ usr.bin/cdio/rip.c 10 Sep

Re: mg: extract exit status from pclose return value

2017-09-06 Thread Scott Cheloha
~2 week bump. Any thoughts or feedback? -- Scott Cheloha > On Aug 25, 2017, at 11:27 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Hi, > > compile_mode() currently just reports the value returned by > pclose(3). This is incorrect because pclose gives you >

pthread_once: don't deadlock on cancel from init_routine

2017-10-01 Thread Scott Cheloha
ter and I'm out of my depth. And given the recent interface migrations I don't know which is most appropriate. Thoughts? -- Scott Cheloha P.S. I've never cvs-add'd directories or files before. Or written a bsd.regress.mk regression test. Did my best to make it look like the others in regress/lib/libp

readlink: be quiet about overlong argument without '-f' option

2017-09-04 Thread Scott Cheloha
as part of a larger patch that didn't make sense in aggregate. Thoughts? -- Scott Cheloha Index: usr.bin/readlink/readlink.c === RCS file: /cvs/src/usr.bin/readlink/readlink.c,v retrieving revision 1.27 diff -u -p -r1.27 readlink.c

Re: ftp: use mono clock for transfer estimates, stats

2017-09-01 Thread Scott Cheloha
2 week bump. -- Scott Cheloha > On Aug 19, 2017, at 9:40 AM, Scott Cheloha <scottchel...@gmail.com> wrote: > > Hi, > > Same deal here as in dd(1). We're displaying an elapsed time > so we want a monotonic clock. > > Because everything printed is

ftp: leak in progressmeter()

2017-09-03 Thread Scott Cheloha
(3), but the code in progressmeter() is really hairy so I think this will do for now. Anyway, title gets nullified (NULL'd?) after it is freed in the successful case, and it is non-global and static and initialized to NULL, so adding a free before we allocate it plugs the leak. Feedback? -- Scott

lock(1): wipe hash before exit in one-time password case

2017-08-30 Thread Scott Cheloha
Hi, In the one-time password case we want to wipe the hash itself before exit, right? This must have slipped through when tedu@ patiently rewrote and committed my botched patch a little while back. -- Scott Cheloha P.S. I didn't botch it this time, right? Index: usr.bin/lock/lock.c

Re: mg: fgetln -> getline

2017-10-11 Thread Scott Cheloha
> On Oct 11, 2017, at 2:36 AM, Florian Obser <flor...@openbsd.org> wrote: > > On Sun, Sep 17, 2017 at 02:56:32AM +, Scott Cheloha wrote: >> >> >> if (buf[len - 1] == '\n') >> buf[len - 1] = '\0'; > > the diff reads fine to m

files.macppc: fix recursive dependency, parallel build race

2017-10-10 Thread Scott Cheloha
? -- Scott Cheloha Index: sys/arch/macppc/conf/files.macppc === RCS file: /cvs/src/sys/arch/macppc/conf/files.macppc,v retrieving revision 1.88 diff -u -p -r1.88 files.macppc --- sys/arch/macppc/conf/files.macppc 13 Jun 2017 01:44:27

dd: exit nonzero on receipt of SIGINT

2017-10-23 Thread Scott Cheloha
diff?r1=1.19=1.20_with_tag=MAIN=h This is the most unique interpretation I found. But my gut says that this is a misreading of "exit as though terminated by SIGINT," and that exiting with 128 + signo is closer to what was meant. Thoughts? -- Scott Cheloha

Re: mg: extract exit status from pclose return value

2017-10-23 Thread Scott Cheloha
> On Aug 25, 2017, at 11:27 PM, Scott Cheloha <scottchel...@gmail.com> wrote: > > compile_mode() currently just reports the value returned by > pclose(3). This is incorrect because pclose gives you > whatever wait4(2) returned, which needs to be examined > wi

isakmpd: use monotonic clock for event timeouts

2017-11-24 Thread Scott Cheloha
. Thoughts and feedback? -- Scott Cheloha Index: sbin/isakmpd/connection.c === RCS file: /cvs/src/sbin/isakmpd/connection.c,v retrieving revision 1.38 diff -u -p -r1.38 connection.c --- sbin/isakmpd/connection.c 6 Aug 2017 13:54:04

Re: openssl s_time, speed: use monotime for absolute interval measurement

2017-11-24 Thread Scott Cheloha
> On Nov 24, 2017, at 6:58 AM, Jeremie Courreges-Anglas <j...@wxcvbn.org> wrote: > > On Wed, Nov 22 2017, Scott Cheloha <scottchel...@gmail.com> wrote: >> Whoops, ignore that last patch, it lacked the >> static changes in apps_posix.c > > This l

less: use monotonic clock for line number echo

2017-11-22 Thread Scott Cheloha
Hi, The "Calculating line numbers" echo in less(1) is meant to fire after an interval has elapsed, so we should use the monotonic clock to measure. Currently, if the system time is changed during the execution of find_linenum() the echo fires too quickly or not at all. -- Scott Chel

Re: openssl s_time, speed: use monotime for absolute interval measurement

2017-11-22 Thread Scott Cheloha
Whoops, ignore that last patch, it lacked the static changes in apps_posix.c -- Scott Cheloha Index: usr.bin/openssl/apps_posix.c === RCS file: /cvs/src/usr.bin/openssl/apps_posix.c,v retrieving revision 1.2 diff -u -p -r1.2

Re: openssl s_time, speed: use monotime for absolute interval measurement

2017-11-22 Thread Scott Cheloha
On Sat, Nov 18, 2017 at 05:27:14PM +0100, Jeremie Courreges-Anglas wrote: > On Sat, Nov 11 2017, Scott Cheloha <scottchel...@gmail.com> wrote: > > [...] > > I doubt that timersub/timespecsub are a big problem to add to -portable, > they're just macros. clock_gettime and g

Re: isakmpd: use monotonic clock for event timeouts

2017-11-29 Thread Scott Cheloha
On Mon, Nov 27, 2017 at 08:36:33PM -0600, Scott Cheloha wrote: > > > On Nov 27, 2017, at 9:54 AM, Jeremie Courreges-Anglas <j...@wxcvbn.org> > > wrote: > > > > On Fri, Nov 24 2017, Scott Cheloha <scottchel...@gmail.com> wrote: > >> Hi, &

Re: isakmpd: use monotonic clock for event timeouts

2017-11-27 Thread Scott Cheloha
> On Nov 27, 2017, at 9:54 AM, Jeremie Courreges-Anglas <j...@wxcvbn.org> wrote: > > On Fri, Nov 24 2017, Scott Cheloha <scottchel...@gmail.com> wrote: >> Hi, >> >> [...] >> >> Thoughts and feedback? > > This seems to mix re

isakmpd.8: define "SA" abbreviation before use

2017-11-23 Thread Scott Cheloha
Hi, This makes parts of isakmpd(8) more immediately intelligible to a beginner. -- Scott Cheloha Index: sbin/isakmpd/isakmpd.8 === RCS file: /cvs/src/sbin/isakmpd/isakmpd.8,v retrieving revision 1.118 diff -u -p -r1.118 isakmpd.8

fortune: typo: than -> then

2017-11-24 Thread Scott Cheloha
Index: games/fortune/datfiles/fortunes2 === RCS file: /cvs/src/games/fortune/datfiles/fortunes2,v retrieving revision 1.48 diff -u -p -r1.48 fortunes2 --- games/fortune/datfiles/fortunes213 Jul 2017 02:45:56 - 1.48 +++

tmux: selective application of monotonic clock

2017-12-05 Thread Scott Cheloha
complicated because they are user-facing and serve multiple purposes: a mix of timestamps, heuristics, and interval measurements. So those merit a separate discussion and might not be worth the added complexity. Thoughts and feedback? -- Scott Cheloha Index: usr.bin/tmux/Makefile

clock_gettime: add CLOCK_BOOTTIME clockid

2017-12-14 Thread Scott Cheloha
their ok. Thoughts and feedback? -- Scott Cheloha [1] https://marc.info/?l=linux-kernel=129783004314557=2 [2] https://github.com/torvalds/linux/commit/420c1c572d4ceaa2f37b6311b7017ac6cf049fe2 Index: lib/libc/sys/clock_gettime.2 === RCS

Re: pppd: explicit_bzero sensitive buffers

2017-11-17 Thread Scott Cheloha
> On Nov 17, 2017, at 3:07 PM, Stuart Henderson <s...@spacehopper.org> wrote: > > On 2017/11/17 21:55, Jeremie Courreges-Anglas wrote: >> On Sat, Nov 11 2017, Scott Cheloha <scottchel...@gmail.com> wrote: >>> Hi, >>> >>> You want explicit

Re: pppd: explicit_bzero sensitive buffers

2017-11-11 Thread Scott Cheloha
> On Nov 11, 2017, at 7:30 PM, Matthew Martin <phy1...@gmail.com> wrote: > > There's a stray whitespace change and explicit sorts below exit. [...] Whoops, here you go. -- Scott Cheloha Index: usr.sbin/pppd/auth.c =

pppd: explicit_bzero sensitive buffers

2017-11-11 Thread Scott Cheloha
Hi, You want explicit_bzero(3) for these buffers. Zeroing a buffer is compiler- and system-dependent, so I added a new macro. I'll send a pull request upstream if this goes in. -- Scott Cheloha Index: usr.sbin/pppd/auth.c === RCS

openssl s_time, speed: use monotime for absolute interval measurement

2017-11-11 Thread Scott Cheloha
. Is this a problem for libressl-portable? Thoughts and feedback? -- Scott Cheloha Index: usr.bin/openssl/apps.h === RCS file: /cvs/src/usr.bin/openssl/apps.h,v retrieving revision 1.19 diff -u -p -r1.19 apps.h --- usr.bin/openssl/apps.h 30 Aug

__warn_references: drop redundant "warning: " prefix

2017-11-12 Thread Scott Cheloha
Hi, GNU ld has prefixed the contents of .gnu.warning.SYMBOL sections with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. If LLVM ld ever acknowledges .gnu.warning sections I imagine it would emulate this behavior. Thoughts? -- Scott Cheloha

Re: gettimeofday(2) does not conform to POSIX.1-2008?

2017-12-02 Thread Scott Cheloha
ribe a system incompletely, > it makes it harder for software developers to consider them as a > proscriptive or leading agency. Errors result. How apropos that I write "behavior" when I meant "wording." Point well taken. -- Scott Cheloha

Re: gettimeofday(2) does not conform to POSIX.1-2008?

2017-12-02 Thread Scott Cheloha
nly zero" behavior traces back at least as far as here (SUSv2, I think): http://pubs.opengroup.org/onlinepubs/7908799/xsh/gettimeofday.html so if it's an error it isn't a "new" error. > > Does this make our implementation non-conforming and does something > > in the manpage need to change? > > I don't think anything should change. Okay. Appreciate the quick reply! -- Scott Cheloha

gettimeofday(2) does not conform to POSIX.1-2008?

2017-12-02 Thread Scott Cheloha
r implementation non-conforming and does something in the manpage need to change? I do note that gettimeofday(2) predates [3] POSIX (and me :p), so perhaps this is just an ancient compromise between BSD and the standards committees? Thoughts? -- Scott Cheloha [1] http://pubs.opengroup.org/

Re: openssl s_time, speed: use monotime for absolute interval measurement

2017-12-05 Thread Scott Cheloha
ere with the same. A subsequent diff will expose the separate functions to the rest of the modules via apps.h, and later diffs in, e.g., speed and s_time, can make use of the now-distinct timer routines at their leisure. -- Scott Cheloha > Index: apps.h > ===

TIMEVAL_TO_TIMESPEC, etc: use do-loop for compound macros

2017-12-09 Thread Scott Cheloha
Hi, Per style(9), macros with compound statements are easier used in an if statement when do-loop wrapped. -- Scott Cheloha P.S. Is it just me or does the argument ordering for TIMESPEC_TO_TIMEVAL seem backwards? Index: sys/sys/time.h

grdc: simplify via clock_gettime

2017-12-09 Thread Scott Cheloha
arate diff. -- Scott Cheloha Index: games/grdc/grdc.c === RCS file: /cvs/src/games/grdc/grdc.c,v retrieving revision 1.27 diff -u -p -r1.27 grdc.c --- games/grdc/grdc.c 13 Jul 2017 02:57:52 - 1.27 +++ games/grdc/grdc.c 10 Dec 201

rpc: use monotime for timeouts

2017-12-09 Thread Scott Cheloha
of the if statement in clnt_udp.c. Its use makes the diff simpler. This is probably not adequately tested, though it compiles and I'm not seeing any issues in my (small) NFS setup. Thoughts and feedback? -- Scott Cheloha Index: lib/libc/rpc/clnt_tcp.c

primes: use strtonum(3)

2017-10-29 Thread Scott Cheloha
takers? -- Scott Cheloha Index: games/primes/primes.c === RCS file: /cvs/src/games/primes/primes.c,v retrieving revision 1.23 diff -u -p -r1.23 primes.c --- games/primes/primes.c 31 Aug 2016 04:48:43 - 1.23 +++ games

futex: FUTEX_WAIT: check for normalized timeout

2018-05-08 Thread Scott Cheloha
Hi, futex(2) doesn't do any range checking for timeout for FUTEX_WAIT, though recent Linux does so. I assume we'd also want to validate timeout before waiting. The attached returns EINVAL if timeout's fields are non-normal, documents it, and adds a test case. ok? -- Scott Cheloha Index: lib

dmesg: drop unnecessary

2018-05-14 Thread Scott Cheloha
ok? -- Scott Cheloha Index: sbin/dmesg/dmesg.c === RCS file: /cvs/src/sbin/dmesg/dmesg.c,v retrieving revision 1.29 diff -u -p -r1.29 dmesg.c --- sbin/dmesg/dmesg.c 1 Sep 2017 07:31:45 - 1.29 +++ sbin/dmesg/dmesg.c 14

Re: futex: FUTEX_WAIT: check for normalized timeout

2018-05-09 Thread Scott Cheloha
On Wed, May 09, 2018 at 11:54:15AM +0300, Paul Irofti wrote: > On Wed, May 09, 2018 at 10:37:14AM +0200, Martin Pieuchot wrote: > > On 08/05/18(Tue) 14:57, Scott Cheloha wrote: > > > Hi, > > > > > > futex(2) doesn't do any range checking for timeout for FUTEX_

adjtime, clock_settime, settimeofday: EINVAL for non-normal time inputs

2018-05-10 Thread Scott Cheloha
for these. ok? -- Scott Cheloha jmc:Is past tense preferred in ERRORS? i.e. " specified" vs. " specifies" Index: lib/libc/sys/adjtime.2 === RCS file: /cvs/src/lib/libc/sys/adjtime.2,v retrieving revision 1.

kevent, nanosleep: tighten valid range for incoming tv_nsec

2018-05-11 Thread Scott Cheloha
eep, so I do not believe this change will break anything in ports. FreeBSD and NetBSD both check the incoming timespec in kqueue_scan() against the tighter bound on tv_nsec, so I think it makes sense to do so as well. ok? -- Scott Cheloha Index: sys/kern/kern_even

libsa ctime: zero- and space-padded output

2018-05-22 Thread Scott Cheloha
ime look more like libc's ctime: boot> time Tue May 8 05:03:02 2018 ^ much more "normal". libsa's ctime is used nowhere but boot(8). ok? -- Scott Cheloha Index: sys/lib/libsa/ctime.c === RCS file: /cvs/src/sys/lib

Re: [patch] Remove unnecessary timerclear in tcpbench

2018-05-22 Thread Scott Cheloha
On Sat, May 12, 2018 at 10:18:22AM +0800, Nan Xiao wrote: > Hi tech@, > > Following is a trivial modification which removes unnecessary > initialization of timeval. I am Sorry if this patch seems a little picky. There are half-way cases elsewhere in the tree where we timerclear or timespecclear

Re: [patch] Add error check for fchmod in ldconfig.c

2018-06-07 Thread Scott Cheloha
d for all such processes without LD_LIBRARY_PATH set, which would not be ideal. -- This patch is ok cheloha@ and I can commit this if someone else is ok with it, but I'd really like to hear from someone with more familiarity with the run-time linking process: is my analysis here off-base? -- Scot

add clock_nanosleep(2)

2018-05-26 Thread Scott Cheloha
gotcha case makes debugging and reasoning about code easier. Looking for feedback that I can spruce things up with and then ask for OKs later (assuming there's no objection to including the interface itself). Thoughts & feedback? -- Scott Cheloha [1] https://marc.info/?l=openbsd-

make process.ps_start an uptime instead of a realtime

2018-06-05 Thread Scott Cheloha
? -- Scott Cheloha Index: sys/kern/init_main.c === RCS file: /cvs/src/sys/kern/init_main.c,v retrieving revision 1.277 diff -u -p -r1.277 init_main.c --- sys/kern/init_main.c28 Apr 2018 03:13:04 - 1.277 +++ sys/kern

drop unused BUMPTIME macro

2018-06-04 Thread Scott Cheloha
miod@ dropped the last usage of BUMPTIME circa 5.3. ok? -- Scott Cheloha Index: sys/kern/kern_clock.c === RCS file: /cvs/src/sys/kern/kern_clock.c,v retrieving revision 1.94 diff -u -p -r1.94 kern_clock.c --- sys/kern/kern_clock.c

  1   2   3   4   5   6   7   8   9   >