[tor-commits] [meek/master] The function is called TerminateProcess, not ProcessTerminate.
dcf at torproject.org
dcf at torproject.org
Wed Apr 9 05:56:57 UTC 2014
commit 634c6236d9fbc3471d9561e1d534f326308e536f
Author: David Fifield <david at bamsoftware.com>
Date: Tue Apr 8 02:22:58 2014 -0700
The function is called TerminateProcess, not ProcessTerminate.
---
.gitignore | 2 +-
meek-client-torbrowser/main.go | 2 +-
processterminate-buffer/main.go | 38 --------------------------------------
terminateprocess-buffer/main.go | 38 ++++++++++++++++++++++++++++++++++++++
4 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/.gitignore b/.gitignore
index d442bd2..d6b0e59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
/meek-client/meek-client
/meek-client-torbrowser/meek-client-torbrowser
/meek-server/meek-server
-/processterminate-buffer/processterminate-buffer
+/terminateprocess-buffer/terminateprocess-buffer
diff --git a/meek-client-torbrowser/main.go b/meek-client-torbrowser/main.go
index f7d96f2..ae98328 100644
--- a/meek-client-torbrowser/main.go
+++ b/meek-client-torbrowser/main.go
@@ -150,7 +150,7 @@ func main() {
// On Windows, we don't get a SIGINT or SIGTERM, rather we are killed
// without a chance to clean up our subprocesses. When run inside
- // processterminate-buffer, it is instead processterminate-buffer that
+ // terminateprocess-buffer, it is instead terminateprocess-buffer that
// is killed, and we can detect that event by that our stdin gets
// closed.
// https://trac.torproject.org/projects/tor/ticket/9330
diff --git a/processterminate-buffer/main.go b/processterminate-buffer/main.go
deleted file mode 100644
index 05d586d..0000000
--- a/processterminate-buffer/main.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// This program is designed to sit between tor and a transport plugin on
-// Windows. On Windows, transport plugins are killed with a ProcessTerminate,
-// which doesn't give them a chance to clean up before exiting.
-// https://trac.torproject.org/projects/tor/ticket/9330
-// The idea of this program is that the transport plugin can read from its
-// standard input, which will be closed when this program is terminated. The
-// transport plugin can then treat the stdin-closed event like a SIGTERM.
-package main
-
-import (
- "io"
- "log"
- "os"
- "os/exec"
-)
-
-func main() {
- args := os.Args[1:]
- if len(args) < 1 {
- log.Fatalf("%s needs a command to run", os.Args[0])
- }
- cmd := exec.Command(args[0], args[1:]...)
- stdin, err := cmd.StdinPipe()
- if err != nil {
- log.Fatal(err)
- }
- cmd.Stdout = os.Stdout
- cmd.Stderr = os.Stderr
- err = cmd.Start()
- if err != nil {
- log.Fatal(err)
- }
- io.Copy(stdin, os.Stdin)
- err = cmd.Wait()
- if err != nil {
- log.Fatal(err)
- }
-}
diff --git a/terminateprocess-buffer/main.go b/terminateprocess-buffer/main.go
new file mode 100644
index 0000000..16a7297
--- /dev/null
+++ b/terminateprocess-buffer/main.go
@@ -0,0 +1,38 @@
+// This program is designed to sit between tor and a transport plugin on
+// Windows. On Windows, transport plugins are killed with a TerminateProcess,
+// which doesn't give them a chance to clean up before exiting.
+// https://trac.torproject.org/projects/tor/ticket/9330
+// The idea of this program is that the transport plugin can read from its
+// standard input, which will be closed when this program is terminated. The
+// transport plugin can then treat the stdin-closed event like a SIGTERM.
+package main
+
+import (
+ "io"
+ "log"
+ "os"
+ "os/exec"
+)
+
+func main() {
+ args := os.Args[1:]
+ if len(args) < 1 {
+ log.Fatalf("%s needs a command to run", os.Args[0])
+ }
+ cmd := exec.Command(args[0], args[1:]...)
+ stdin, err := cmd.StdinPipe()
+ if err != nil {
+ log.Fatal(err)
+ }
+ cmd.Stdout = os.Stdout
+ cmd.Stderr = os.Stderr
+ err = cmd.Start()
+ if err != nil {
+ log.Fatal(err)
+ }
+ io.Copy(stdin, os.Stdin)
+ err = cmd.Wait()
+ if err != nil {
+ log.Fatal(err)
+ }
+}
More information about the tor-commits
mailing list