Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Drew Northup
I presume that I should apply this change to my porting of git_mkstemps_mode() to tig. If there are no complaints about this for a couple of days I will do so. REF: $gmane/229961 On 07/17/2013 03:29 PM, Junio C Hamano wrote: Thomas Rasttr...@inf.ethz.ch writes: Thomas Rasttr...@inf.ethz.ch

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Junio C Hamano
Drew Northup n1xim.em...@gmail.com writes: I presume that I should apply this change to my porting of git_mkstemps_mode() to tig. If there are no complaints about this for a couple of days I will do so. Hmph, Thomas and I were actually asking you to give us Signed-off-by: Drew

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Drew Northup n1xim.em...@gmail.com writes: I presume that I should apply this change to my porting of git_mkstemps_mode() to tig. If there are no complaints about this for a couple of days I will do so. Hmph, Thomas and I were actually asking you to

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Dale R. Worley
I've been looking into writing a proper test for this patch. My first attempt tests the symptom that was seen initially, that git commit fails if fd 0 is closed. One problem is how to arrange for fd 0 to be closed. I could use the bash redirection -, but I think you want to be more portable

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Junio C Hamano
On Thu, Jul 18, 2013 at 1:32 PM, Dale R. Worley wor...@alum.mit.edu wrote: I've been looking into writing a proper test for this patch. My first attempt tests the symptom that was seen initially, that git commit fails if fd 0 is closed. One problem is how to arrange for fd 0 to be closed. I

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Dale R. Worley
From: Junio C Hamano gits...@pobox.com That's just a plain-vanilla part of POSIX shell behaviour, no? http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_05 Close standard input is so weird I never thought it was Posix. In that case, we can eliminate the C

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Junio C Hamano
wor...@alum.mit.edu (Dale R. Worley) writes: From: Junio C Hamano gits...@pobox.com That's just a plain-vanilla part of POSIX shell behaviour, no? http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_05 Close standard input is so weird I never thought it was

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-18 Thread Dale R. Worley
From: Junio C Hamano gits...@pobox.com +test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' ' + git init + echo Test. test-file + git add test-file + git commit -m Message. - +' + Yup. I wonder how it would fail without the fix, though ;-) Eh,

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-17 Thread Junio C Hamano
Thomas Rast tr...@inf.ethz.ch writes: Thomas Rast tr...@inf.ethz.ch writes: From: Dale R. Worley wor...@alum.mit.edu open() returns -1 on failure, and indeed 0 is a possible success value if the user closed stdin in our process. Fix the test. Signed-off-by: Thomas Rast tr...@inf.ethz.ch

Re: [PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-16 Thread Thomas Rast
Thomas Rast tr...@inf.ethz.ch writes: From: Dale R. Worley wor...@alum.mit.edu open() returns -1 on failure, and indeed 0 is a possible success value if the user closed stdin in our process. Fix the test. Signed-off-by: Thomas Rast tr...@inf.ethz.ch I see you have this in 'pu' without

[PATCH 1/2] git_mkstemps: correctly test return value of open()

2013-07-12 Thread Thomas Rast
From: Dale R. Worley wor...@alum.mit.edu open() returns -1 on failure, and indeed 0 is a possible success value if the user closed stdin in our process. Fix the test. Signed-off-by: Thomas Rast tr...@inf.ethz.ch --- wrapper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git