Update git patch to use null: in sanitize_stdfs

This commit is contained in:
Jeremy Soller 2018-12-02 14:24:06 -07:00
parent 707f10e096
commit 3ccc94cb1a
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1

View File

@ -1,6 +1,6 @@
diff -ru source/builtin/log.c source-new/builtin/log.c
--- source/builtin/log.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/builtin/log.c 2017-08-15 13:29:42.346302539 -0700
--- source/builtin/log.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/builtin/log.c 2018-12-02 14:18:59.800197927 -0700
@@ -308,6 +308,7 @@
static void setup_early_output(struct rev_info *rev)
@ -18,8 +18,8 @@ diff -ru source/builtin/log.c source-new/builtin/log.c
static void finish_early_output(struct rev_info *rev)
diff -ru source/common-main.c source-new/common-main.c
--- source/common-main.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/common-main.c 2017-08-15 13:29:42.346302539 -0700
--- source/common-main.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/common-main.c 2018-12-02 14:18:59.800197927 -0700
@@ -15,12 +15,14 @@
*/
static void restore_sigpipe_to_default(void)
@ -36,8 +36,8 @@ diff -ru source/common-main.c source-new/common-main.c
int main(int argc, const char **argv)
diff -ru source/compat/hstrerror.c source-new/compat/hstrerror.c
--- source/compat/hstrerror.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/compat/hstrerror.c 2017-08-15 13:29:42.346302539 -0700
--- source/compat/hstrerror.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/compat/hstrerror.c 2018-12-02 14:18:59.800197927 -0700
@@ -5,17 +5,6 @@
const char *githstrerror(int err)
{
@ -57,8 +57,8 @@ diff -ru source/compat/hstrerror.c source-new/compat/hstrerror.c
return buffer;
}
diff -ru source/compat/poll/poll.c source-new/compat/poll/poll.c
--- source/compat/poll/poll.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/compat/poll/poll.c 2017-08-15 13:29:42.346302539 -0700
--- source/compat/poll/poll.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/compat/poll/poll.c 2018-12-02 14:18:59.800197927 -0700
@@ -302,7 +302,7 @@
happened |= (POLLIN | POLLRDNORM) & sought;
@ -69,8 +69,8 @@ diff -ru source/compat/poll/poll.c source-new/compat/poll/poll.c
happened |= POLLHUP;
diff -ru source/compat/terminal.c source-new/compat/terminal.c
--- source/compat/terminal.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/compat/terminal.c 2017-08-15 13:29:42.349635894 -0700
--- source/compat/terminal.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/compat/terminal.c 2018-12-02 14:18:59.800197927 -0700
@@ -3,7 +3,9 @@
#include "sigchain.h"
#include "strbuf.h"
@ -95,8 +95,8 @@ diff -ru source/compat/terminal.c source-new/compat/terminal.c
#endif
diff -ru source/config.c source-new/config.c
--- source/config.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/config.c 2017-08-15 13:29:42.349635894 -0700
--- source/config.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/config.c 2018-12-02 14:18:59.800197927 -0700
@@ -1094,7 +1094,7 @@
}
@ -107,8 +107,8 @@ diff -ru source/config.c source-new/config.c
/* This value must be multiple of (pagesize * 2) */
diff -ru source/connect.c source-new/connect.c
--- source/connect.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/connect.c 2017-08-15 13:29:42.349635894 -0700
--- source/connect.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/connect.c 2018-12-02 14:18:59.800197927 -0700
@@ -450,14 +450,11 @@
he = gethostbyname(host);
@ -136,8 +136,8 @@ diff -ru source/connect.c source-new/connect.c
diff -ru source/credential-cache--daemon.c source-new/credential-cache--daemon.c
--- source/credential-cache--daemon.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/credential-cache--daemon.c 2017-08-15 13:29:42.349635894 -0700
--- source/credential-cache--daemon.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/credential-cache--daemon.c 2018-12-02 14:18:59.800197927 -0700
@@ -156,6 +156,7 @@
strbuf_release(&action);
}
@ -173,8 +173,8 @@ diff -ru source/credential-cache--daemon.c source-new/credential-cache--daemon.c
return 0;
}
diff -ru source/daemon.c source-new/daemon.c
--- source/daemon.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/daemon.c 2017-08-15 13:30:19.439876374 -0700
--- source/daemon.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/daemon.c 2018-12-02 14:18:59.804197591 -0700
@@ -71,6 +71,7 @@
return hi->ip_address.buf;
}
@ -309,8 +309,8 @@ diff -ru source/daemon.c source-new/daemon.c
} else
/* avoid splitting a message in the middle */
diff -ru source/dir.c source-new/dir.c
--- source/dir.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/dir.c 2017-08-15 13:29:42.352969248 -0700
--- source/dir.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/dir.c 2018-12-02 14:18:59.804197591 -0700
@@ -1891,14 +1891,14 @@
static const char *get_ident_string(void)
{
@ -331,8 +331,8 @@ diff -ru source/dir.c source-new/dir.c
}
diff -ru source/fast-import.c source-new/fast-import.c
--- source/fast-import.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/fast-import.c 2017-08-15 13:29:42.352969248 -0700
--- source/fast-import.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/fast-import.c 2018-12-02 14:18:59.804197591 -0700
@@ -531,6 +531,7 @@
static void set_checkpoint_signal(void)
@ -350,8 +350,8 @@ diff -ru source/fast-import.c source-new/fast-import.c
#endif
diff -ru source/git-compat-util.h source-new/git-compat-util.h
--- source/git-compat-util.h 2017-06-04 18:08:11.000000000 -0700
+++ source-new/git-compat-util.h 2017-08-15 13:29:42.356302602 -0700
--- source/git-compat-util.h 2017-06-04 19:08:11.000000000 -0600
+++ source-new/git-compat-util.h 2018-12-02 14:18:59.804197591 -0700
@@ -179,7 +179,6 @@
#include <assert.h>
#include <regex.h>
@ -402,8 +402,8 @@ diff -ru source/git-compat-util.h source-new/git-compat-util.h
+
#endif
diff -ru source/Makefile source-new/Makefile
--- source/Makefile 2017-06-04 18:08:11.000000000 -0700
+++ source-new/Makefile 2017-08-15 13:29:42.356302602 -0700
--- source/Makefile 2017-06-04 19:08:11.000000000 -0600
+++ source-new/Makefile 2018-12-02 14:18:59.804197591 -0700
@@ -1802,7 +1802,6 @@
$(BUILT_INS): git$X
@ -444,8 +444,8 @@ diff -ru source/Makefile source-new/Makefile
cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
done && \
diff -ru source/progress.c source-new/progress.c
--- source/progress.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/progress.c 2017-08-15 13:29:42.356302602 -0700
--- source/progress.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/progress.c 2018-12-02 14:18:59.804197591 -0700
@@ -52,11 +52,13 @@
progress_update = 0;
@ -471,8 +471,8 @@ diff -ru source/progress.c source-new/progress.c
static int display(struct progress *progress, unsigned n, const char *done)
diff -ru source/rerere.c source-new/rerere.c
--- source/rerere.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/rerere.c 2017-08-15 13:29:42.356302602 -0700
--- source/rerere.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/rerere.c 2018-12-02 14:18:59.804197591 -0700
@@ -682,7 +682,7 @@
* A successful replay of recorded resolution.
* Mark that "postimage" was used to help gc.
@ -483,8 +483,8 @@ diff -ru source/rerere.c source-new/rerere.c
rerere_path(id, "postimage"));
diff -ru source/run-command.c source-new/run-command.c
--- source/run-command.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/run-command.c 2017-08-15 13:29:42.359635956 -0700
--- source/run-command.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/run-command.c 2018-12-02 14:18:59.804197591 -0700
@@ -138,7 +138,7 @@
return NULL;
@ -495,8 +495,8 @@ diff -ru source/run-command.c source-new/run-command.c
strbuf_reset(&buf);
diff -ru source/send-pack.c source-new/send-pack.c
--- source/send-pack.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/send-pack.c 2017-08-15 13:29:42.359635956 -0700
--- source/send-pack.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/send-pack.c 2018-12-02 14:18:59.804197591 -0700
@@ -570,7 +570,7 @@
if (args->stateless_rpc)
close(out);
@ -507,9 +507,26 @@ diff -ru source/send-pack.c source-new/send-pack.c
/*
* Do not even bother with the return value; we know we
diff -ru source/setup.c source-new/setup.c
--- source/setup.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/setup.c 2017-08-15 13:29:42.359635956 -0700
@@ -1157,7 +1157,7 @@
--- source/setup.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/setup.c 2018-12-02 14:19:36.749210959 -0700
@@ -1143,21 +1143,21 @@
return read_gitfile_gently(suspect, return_error_code);
}
-/* if any standard file descriptor is missing open it to /dev/null */
+/* if any standard file descriptor is missing open it to null: */
void sanitize_stdfds(void)
{
- int fd = open("/dev/null", O_RDWR, 0);
+ int fd = open("null:", O_RDWR, 0);
while (fd != -1 && fd < 2)
fd = dup(fd);
if (fd == -1)
- die_errno("open /dev/null or dup failed");
+ die_errno("open null: or dup failed");
if (fd > 2)
close(fd);
}
int daemonize(void)
{
@ -519,8 +536,8 @@ diff -ru source/setup.c source-new/setup.c
return -1;
#else
diff -ru source/sha1_file.c source-new/sha1_file.c
--- source/sha1_file.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/sha1_file.c 2017-08-15 13:29:42.359635956 -0700
--- source/sha1_file.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/sha1_file.c 2018-12-02 14:18:59.824195916 -0700
@@ -723,7 +723,7 @@
"pack_report: getpagesize() = %10" SZ_FMT "\n"
"pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
@ -531,8 +548,8 @@ diff -ru source/sha1_file.c source-new/sha1_file.c
sz_fmt(packed_git_limit));
fprintf(stderr,
diff -ru source/strbuf.c source-new/strbuf.c
--- source/strbuf.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/strbuf.c 2017-08-15 13:29:42.359635956 -0700
--- source/strbuf.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/strbuf.c 2018-12-02 14:18:59.824195916 -0700
@@ -446,6 +446,11 @@
for (;; guessed_len *= 2) {
strbuf_grow(sb, guessed_len);
@ -546,8 +563,8 @@ diff -ru source/strbuf.c source-new/strbuf.c
return 0;
}
diff -ru source/wrapper.c source-new/wrapper.c
--- source/wrapper.c 2017-06-04 18:08:11.000000000 -0700
+++ source-new/wrapper.c 2017-08-15 13:29:42.359635956 -0700
--- source/wrapper.c 2017-06-04 19:08:11.000000000 -0600
+++ source-new/wrapper.c 2018-12-02 14:18:59.824195916 -0700
@@ -227,6 +227,7 @@
}
}