mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Fix order in which pipes are opened on linux.
This commit is contained in:
parent
f9dab3679c
commit
549fa48a24
@ -54,13 +54,17 @@ void PipeServer()
|
||||
|
||||
for(;;)
|
||||
{
|
||||
// open to (incoming) pipe first.
|
||||
printf( "Obtaining pipe\n" );
|
||||
bConnected = ConnectNamedPipe(hPipeToSrv, NULL) ?
|
||||
TRUE : (GetLastError()==ERROR_PIPE_CONNECTED );
|
||||
printf( "Obtained to-srv %i\n", bConnected );
|
||||
|
||||
// open from (outgoing) pipe second. This could block if there is no reader.
|
||||
bConnected = ConnectNamedPipe(hPipeFromSrv, NULL) ?
|
||||
TRUE : (GetLastError()==ERROR_PIPE_CONNECTED );
|
||||
printf( "Obtained from-srv %i\n", bConnected );
|
||||
|
||||
if( bConnected )
|
||||
{
|
||||
for(;;)
|
||||
@ -142,13 +146,7 @@ void PipeServer()
|
||||
// return;
|
||||
}
|
||||
|
||||
fromFifo = fopen(fromFifoName, "w");
|
||||
if (fromFifo == NULL)
|
||||
{
|
||||
perror("Unable to open fifo from server to script");
|
||||
return;
|
||||
}
|
||||
|
||||
// open to (incoming) pipe first.
|
||||
toFifo = fopen(toFifoName, "r");
|
||||
if (toFifo == NULL)
|
||||
{
|
||||
@ -158,6 +156,14 @@ void PipeServer()
|
||||
return;
|
||||
}
|
||||
|
||||
// open from (outgoing) pipe second. This could block if there is no reader.
|
||||
fromFifo = fopen(fromFifoName, "w");
|
||||
if (fromFifo == NULL)
|
||||
{
|
||||
perror("Unable to open fifo from server to script");
|
||||
return;
|
||||
}
|
||||
|
||||
while (fgets(buf, sizeof(buf), toFifo) != NULL)
|
||||
{
|
||||
int len = strlen(buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user