summaryrefslogtreecommitdiff
path: root/wrapper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-25 14:42:31 -0700
committerJunio C Hamano <gitster@pobox.com>2022-08-25 14:42:32 -0700
commita103ad6f3d58cf3d297a6b102876e2bbf09c98d7 (patch)
tree763c63d41c7c3d9fadf0ebbe76e9fc90f81743a8 /wrapper.c
parent098b7bfaa6c415f2b23885b82d6b5a31a8cdb7d2 (diff)
parent716c1f649e372a0784b9826cd3839e7b373e2ea9 (diff)
downloadgit-a103ad6f3d58cf3d297a6b102876e2bbf09c98d7.tar.gz
Merge branch 'jk/pipe-command-nonblock'
Fix deadlocks between main Git process and subprocess spawned via the pipe_command() API, that can kill "git add -p" that was reimplemented in C recently. * jk/pipe-command-nonblock: pipe_command(): mark stdin descriptor as non-blocking pipe_command(): handle ENOSPC when writing to a pipe pipe_command(): avoid xwrite() for writing to pipe git-compat-util: make MAX_IO_SIZE define globally available nonblock: support Windows compat: add function to enable nonblocking pipes
Diffstat (limited to 'wrapper.c')
-rw-r--r--wrapper.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/wrapper.c b/wrapper.c
index cfe79bd081..299d6489a6 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -161,28 +161,6 @@ void xsetenv(const char *name, const char *value, int overwrite)
die_errno(_("could not setenv '%s'"), name ? name : "(null)");
}
-/*
- * Limit size of IO chunks, because huge chunks only cause pain. OS X
- * 64-bit is buggy, returning EINVAL if len >= INT_MAX; and even in
- * the absence of bugs, large chunks can result in bad latencies when
- * you decide to kill the process.
- *
- * We pick 8 MiB as our default, but if the platform defines SSIZE_MAX
- * that is smaller than that, clip it to SSIZE_MAX, as a call to
- * read(2) or write(2) larger than that is allowed to fail. As the last
- * resort, we allow a port to pass via CFLAGS e.g. "-DMAX_IO_SIZE=value"
- * to override this, if the definition of SSIZE_MAX given by the platform
- * is broken.
- */
-#ifndef MAX_IO_SIZE
-# define MAX_IO_SIZE_DEFAULT (8*1024*1024)
-# if defined(SSIZE_MAX) && (SSIZE_MAX < MAX_IO_SIZE_DEFAULT)
-# define MAX_IO_SIZE SSIZE_MAX
-# else
-# define MAX_IO_SIZE MAX_IO_SIZE_DEFAULT
-# endif
-#endif
-
/**
* xopen() is the same as open(), but it die()s if the open() fails.
*/