SHA256
1
0
forked from pool/systemtap
systemtap/systemtap-netcat-fix2.diff

49 lines
1.5 KiB
Diff

From 0b7f181e1096f8833e24a60a7c0f97ecc063b9f4 Mon Sep 17 00:00:00 2001
From: Dave Brolley <brolley@redhat.com>
Date: Thu, 11 Dec 2008 12:07:02 -0500
Subject: [PATCH] Don't use -d on $netcat. Redirect from /dev/null instead.
---
diff --git a/stap-client b/stap-client
index 255551b..3f530c7 100755
--- a/stap-client
+++ b/stap-client
@@ -410,7 +410,7 @@ function receive_response {
# Retrieve the file. Wait for up to 5 minutes for a response.
for ((attempt=0; $attempt < 300; ++attempt))
do
- if $netcat -d $server $(($port+1)) > $tar_server 2>/dev/null; then
+ if $netcat $server $(($port+1)) </dev/null > $tar_server 2>/dev/null; then
return;
fi
sleep 1
diff --git a/stap-server b/stap-server
index a06adc9..0a7d597 100755
--- a/stap-server
+++ b/stap-server
@@ -58,7 +58,7 @@ function receive_request {
fatal "ERROR: cannot create temporary tar file " $tar_client
# Receive the file.
- $netcat -ld $port > $tar_client 2>/dev/null &
+ $netcat -l $port < /dev/null > $tar_client 2>/dev/null &
# Wait for 10 seconds before timing out
for ((t=0; $t < 10; ++t))
diff --git a/stap-serverd b/stap-serverd
index b46a425..d4d6a77 100755
--- a/stap-serverd
+++ b/stap-serverd
@@ -65,7 +65,7 @@ function listen {
do
for ((attempt=0; $attempt < 5; ++attempt))
do
- $netcat -ld $port 2>/dev/null | process_request &
+ $netcat -l $port < /dev/null 2>/dev/null | process_request &
wait '%$netcat -l'
rc=$?
if test $rc = 0 -o $rc = 127; then
--
1.6.0.5