PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Doug Hogan
Index: bin/csh/dol.c === RCS file: /cvs/src/bin/csh/dol.c,v retrieving revision 1.17 diff -u -p -d -r1.17 dol.c --- bin/csh/dol.c 12 Aug 2010 02:00:27 - 1.17 +++ bin/csh/dol.c 11 Jul 2014 09:12:11 - @@ -829,7

Re: PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Ville Valkonen
On 11 July 2014 12:41, Doug Hogan d...@acyclic.org wrote: Index: bin/csh/dol.c === RCS file: /cvs/src/bin/csh/dol.c,v retrieving revision 1.17 diff -u -p -d -r1.17 dol.c --- bin/csh/dol.c 12 Aug 2010 02:00:27 -

Re: PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Philip Guenther
On Fri, Jul 11, 2014 at 11:41 AM, Doug Hogan d...@acyclic.org wrote: Index: sbin/disklabel/disklabel.c === RCS file: /cvs/src/sbin/disklabel/disklabel.c,v retrieving revision 1.195 diff -u -p -d -r1.195 disklabel.c ---

Re: PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Doug Hogan
On Fri, Jul 11, 2014 at 12:19:22PM +0200, Philip Guenther wrote: This should call warn() before unlink() or close() to guarantee that the correct errno value is reported. Philip, I see what you are saying. I was following the man page example in mkstemp(3) which calls warn() after

Re: PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Doug Hogan
On Fri, Jul 11, 2014 at 12:19:22PM +0200, Philip Guenther wrote: This should call warn() before unlink() or close() to guarantee that the correct errno value is reported. ... This and several other need to save errno and use errc(), ala: Updated patch. Updated mktemp.3 this time. Index:

Re: PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Marc Espie
On Fri, Jul 11, 2014 at 04:55:36PM +, Doug Hogan wrote: Index: usr.bin/m4/eval.c === RCS file: /cvs/src/usr.bin/m4/eval.c,v retrieving revision 1.72 diff -u -p -d -r1.72 eval.c --- usr.bin/m4/eval.c 28 Apr 2014 12:34:11

Re: PATCH: misc mkstemp and fdopen fixes

2014-07-11 Thread Doug Hogan
On Fri, Jul 11, 2014 at 07:29:06PM +0200, Marc Espie wrote: I don't like that part. The logic is a bit wrong. Especially since unlink(fname) is always called for fd != -1, so I feel there should be one single call. Ok Index: usr.bin/m4/eval.c