mirror of https://github.com/YosysHQ/abc.git
Fixed a problem in BridgeMode; it will now correctly detect if the pipe has been closed and exit ABC.
This commit is contained in:
parent
fe40fd5c80
commit
43df8967b5
|
|
@ -22,6 +22,9 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#ifdef LIN
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "aig/gia/gia.h"
|
||||
|
||||
|
|
@ -124,9 +127,24 @@ void Gia_CreateHeader( FILE * pFile, int Type, int Size, unsigned char * pBuffer
|
|||
fprintf( pFile, " " );
|
||||
fprintf( pFile, "%.16d", Size );
|
||||
fprintf( pFile, " " );
|
||||
#ifndef LIN
|
||||
RetValue = fwrite( pBuffer, Size, 1, pFile );
|
||||
assert( RetValue == 1 || Size == 0);
|
||||
fflush( pFile );
|
||||
#else
|
||||
fflush(pFile);
|
||||
int fd = fileno(pFile);
|
||||
|
||||
ssize_t bytes_written = 0;
|
||||
while (bytes_written < Size){
|
||||
ssize_t n = write(fd, &pBuffer[bytes_written], Size - bytes_written);
|
||||
if (n < 0){
|
||||
fprintf(stderr, "BridgeMode: failed to send package; aborting\n"); fflush(stderr);
|
||||
_exit(255);
|
||||
}
|
||||
bytes_written += n;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -244,7 +262,7 @@ int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex )
|
|||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
|
@ -393,7 +411,7 @@ int Gia_ManFromBridgeReadPackage( FILE * pFile, int * pType, int * pSize, unsign
|
|||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
|
@ -439,7 +457,7 @@ Gia_Man_t * Gia_ManFromBridge( FILE * pFile, Vec_Int_t ** pvInit )
|
|||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
|
@ -462,7 +480,7 @@ void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p, int msg_typ
|
|||
Synopsis []
|
||||
|
||||
Description []
|
||||
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
|
|
|||
Loading…
Reference in New Issue