Re: prefer dprintf() over snprintf()+write()

2015-10-12 Thread Theo de Raadt
> Actually, plain old printf should be OK in ping.c since buffering > is disabled for ping -f. If you want to keep dprintf(), I think > we can lose the setbuf() call. Whatever you decide, it would > be nice to make ping6.c match. No, disagree strongly. ping is doing this inside a signal

Re: prefer dprintf() over snprintf()+write()

2015-10-12 Thread Todd C. Miller
Ah, I didn't realize that pinger() was still called via a signal handler in ping. It looks like ping6 is better in this regard. - todd

Re: prefer dprintf() over snprintf()+write()

2015-10-12 Thread Theo de Raadt
> Ah, I didn't realize that pinger() was still called via a signal > handler in ping. It looks like ping6 is better in this regard. ping and ping6 need to be merged, as happened to traceroute. First step: make all ping6's options match ping options. Rename ping6 options with wild abandon if

Re: prefer dprintf() over snprintf()+write()

2015-10-12 Thread Todd C. Miller
Actually, plain old printf should be OK in ping.c since buffering is disabled for ping -f. If you want to keep dprintf(), I think we can lose the setbuf() call. Whatever you decide, it would be nice to make ping6.c match. - todd

prefer dprintf() over snprintf()+write()

2015-10-10 Thread Philip Guenther
Instead of formatting to a buffer and then writing the buffer to an fd, just use dprintf to write formatted output directly to the fd. Note that our dprintf() has the same async-signal-safety as our snprintf() ok? Philip Guenther Index: newfs/mkfs.c