mod-script-pipe: Rename pipe name

Scripts that communicate with Tenacity now need to be updated to use the
new pipe name, 'tenacity_script_pipe.{to,from}.{pid}'. This should also
prevent conflicts if Audacity's pipe server is running at the same time
with Tenacity's pipe server.

Signed-off-by: Avery King <avery98@pm.me>
This commit is contained in:
Avery King
2023-07-05 13:31:22 -07:00
parent c344adbf9a
commit 80b7f2f3d7
8 changed files with 19 additions and 17 deletions

View File

@@ -114,7 +114,7 @@ void PipeServer()
#include <unistd.h>
#include <string.h>
const char fifotmpl[] = "/tmp/audacity_script_pipe.%s.%d";
const char fifotmpl[] = "/tmp/tenacity_script_pipe.%s.%d";
const int nBuff = 1024;

View File

@@ -19,8 +19,8 @@ def startPipes() :
EOL = '\r\n\0'
else:
print( "pipe-test.py, running on linux or mac" )
toname = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
fromname = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
toname = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
fromname = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
EOL = '\n'
print( "Write to \"" + toname +"\"" )

View File

@@ -17,8 +17,8 @@ if( sys.platform == 'win32' ):
EOL = '\r\n\0'
else:
print( "get-gui-structure.py, running on linux or mac" )
toname = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
fromname = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
toname = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
fromname = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
EOL = '\n'
print( "Write to \"" + toname +"\"" )

View File

@@ -33,12 +33,12 @@ if ($^O eq 'MSWin32') {
$FromSrvName = '\\\\.\\pipe\\From'.$Name.'Pipe';
} elsif ($^O eq 'linux') {
$UID = $<;
$ToSrvName = '/tmp/audacity_script_pipe.to.'.$UID;
$FromSrvName = '/tmp/audacity_script_pipe.from.'.$UID;
$ToSrvName = '/tmp/tenacity_script_pipe.to.'.$UID;
$FromSrvName = '/tmp/tenacity_script_pipe.from.'.$UID;
} elsif ($^O eq 'darwin') {
$UID = $<;
$ToSrvName = '/tmp/audacity_script_pipe.to.'.$UID;
$FromSrvName = '/tmp/audacity_script_pipe.from.'.$UID;
$ToSrvName = '/tmp/tenacity_script_pipe.to.'.$UID;
$FromSrvName = '/tmp/tenacity_script_pipe.from.'.$UID;
}
# Open pipes
@@ -74,7 +74,9 @@ sub stopTiming{
sub sendCommand{
my $command = shift;
if ($^O eq 'MSWin32') {
print TO_SRV "$command
print TO_SRV "$command
\r\n\0";
} else {
# Don't explicitly send \0 on Linux or reads after the first one fail...
print TO_SRV "$command\n";

View File

@@ -25,8 +25,8 @@ if sys.platform == 'win32':
EOL = '\r\n\0'
else:
print("pipe-test.py, running on linux or mac")
TONAME = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
FROMNAME = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
TONAME = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
FROMNAME = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
EOL = '\n'
print("Write to \"" + TONAME +"\"")

View File

@@ -87,7 +87,7 @@ if sys.platform == 'win32':
EOL = '\r\n\0'
else:
# Linux or Mac
PIPE_BASE = '/tmp/audacity_script_pipe.'
PIPE_BASE = '/tmp/tenacity_script_pipe.'
WRITE_NAME = PIPE_BASE + 'to.' + str(os.getuid())
READ_NAME = PIPE_BASE + 'from.' + str(os.getuid())
EOL = '\n'

View File

@@ -62,8 +62,8 @@ if sys.platform == 'win32':
EOL = '\r\n\0'
else:
print("recording-test.py, running on linux or mac")
PIPE_TO_AUDACITY = '/tmp/audacity_script_pipe.to.' + str(os.getuid())
PIPE_FROM_AUDACITY = '/tmp/audacity_script_pipe.from.' + str(os.getuid())
PIPE_TO_AUDACITY = '/tmp/tenacity_script_pipe.to.' + str(os.getuid())
PIPE_FROM_AUDACITY = '/tmp/tenacity_script_pipe.from.' + str(os.getuid())
EOL = '\n'

View File

@@ -32,8 +32,8 @@ end
global TMP_FILENAME;
global EXPORT_TEST_SIGNALS;
UID=num2str(getuid());
PIPE_TO_PATH=strcat("/tmp/audacity_script_pipe.to.", UID);
PIPE_FROM_PATH=strcat("/tmp/audacity_script_pipe.from.", UID);
PIPE_TO_PATH=strcat("/tmp/tenacity_script_pipe.to.", UID);
PIPE_FROM_PATH=strcat("/tmp/tenacity_script_pipe.from.", UID);
TMP_FILENAME=strcat(pwd(), "/tmp.wav");
EXPORT_TEST_SIGNALS = false;