git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git_mkstemps: improve test suite test
@ 2013-08-03  0:27 Dale R. Worley
  2013-08-03  0:36 ` Jonathan Nieder
  2013-08-05 16:21 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Dale R. Worley @ 2013-08-03  0:27 UTC (permalink / raw)
  To: git

Commit 52749 fixes a bug regarding testing the return of an open()
call for success/failure.  Improve the testsuite test for that fix by
removing the helper program 'test-close-fd-0' and replacing it with
the shell redirection '<&-'.  (The redirection is Posix, so it should
be portable.)

Signed-off-by: Dale Worley <worley@ariadne.com>
---

> From: Junio C Hamano <gitster@pobox.com>
> Date: Fri, 19 Jul 2013 07:29:47 -0700
> 
> The change itself looks good; care to write it up as a proper patch
> with a proposed log message?

My apologies for the delay; I've had to do some yak-shaving to learn
how to construct patches properly.  (I've written some clarifications
for Document/SubmittingPatches, which I will submit separately.)

Someone has gone ahead and made the code change, so all that remains
is to update the testsuite test by replacing the helper program
'test-close-fd-0' with the Posix shell redirection '<&-'.

Dale


 Makefile          |    1 -
 test-close-fd-0.c |   14 --------------
 2 files changed, 0 insertions(+), 15 deletions(-)
 delete mode 100644 test-close-fd-0.c

diff --git a/Makefile b/Makefile
index 8ad40d4..3588ca1 100644
--- a/Makefile
+++ b/Makefile
@@ -557,7 +557,6 @@ X =
 PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
 
 TEST_PROGRAMS_NEED_X += test-chmtime
-TEST_PROGRAMS_NEED_X += test-close-fd-0
 TEST_PROGRAMS_NEED_X += test-ctype
 TEST_PROGRAMS_NEED_X += test-date
 TEST_PROGRAMS_NEED_X += test-delta
diff --git a/test-close-fd-0.c b/test-close-fd-0.c
deleted file mode 100644
index 3745c34..0000000
--- a/test-close-fd-0.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <unistd.h>
-
-/* Close file descriptor 0 (which is standard-input), then execute the
- * remainder of the command line as a command. */
-
-int main(int argc, char **argv)
-{
-	/* Close fd 0. */
-	close(0);
-	/* Execute the requested command. */
-	execvp(argv[1], &argv[1]);
-	/* If execve() failed, return an error. */
-	return 1;
-}
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-05 17:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-03  0:27 [PATCH] git_mkstemps: improve test suite test Dale R. Worley
2013-08-03  0:36 ` Jonathan Nieder
2013-08-05 16:21 ` Junio C Hamano
2013-08-05 17:32   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).