[PATCH] git_mkstemps: improve test suite test
From: Dale R. Worley <hidden>
Date: 2016-06-15 22:58:18
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 <redacted> ---
From: Junio C Hamano <redacted> 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