From bbe842a42695a5f392e7acb5b78212e4618f37bb Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Mon, 4 Aug 2014 20:24:06 +0200 Subject: [PATCH] Refactored: Reuse existing code Signed-off-by: Sven Strickroth --- src/libgit2/system-call.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libgit2/system-call.c b/src/libgit2/system-call.c index 526d64244..2c40dc876 100644 --- a/src/libgit2/system-call.c +++ b/src/libgit2/system-call.c @@ -203,14 +203,7 @@ int command_start(wchar_t *cmd, COMMAND_HANDLE *commandHandle, LPWSTR pEnv) int command_read_stdout(COMMAND_HANDLE *commandHandle, char *buffer, size_t buf_size, size_t *bytes_read) { - *bytes_read = 0; - - if (!ReadFile(commandHandle->out, buffer, (DWORD)buf_size, (DWORD*)bytes_read, NULL)) { - giterr_set(GITERR_OS, "could not read data from external process"); - return -1; - } - - return 0; + return command_read(commandHandle->out, buffer, buf_size, bytes_read); } int command_write(COMMAND_HANDLE *commandHandle, const char *buffer, size_t len) -- 2.11.4.GIT