Internalize broken pipe.

This commit is contained in:
n-a-c-h
2006-03-01 15:03:44 +00:00
parent f8a3b935a9
commit 27974851ee

View File

@@ -22,8 +22,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifdef __UNIXSDL__ #ifdef __UNIXSDL__
#include "gblhdr.h" #include "gblhdr.h"
#include <signal.h>
#include "linux/safelib.h" #include "linux/safelib.h"
#include <sys/poll.h>
#define DIR_SLASH "/" #define DIR_SLASH "/"
#define WRITE_BINARY "w" #define WRITE_BINARY "w"
#else #else
@@ -35,6 +35,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <zlib.h> #include <zlib.h>
#define signal(x, y)
#ifdef __WIN32__ #ifdef __WIN32__
#include <direct.h> #include <direct.h>
#include <io.h> #include <io.h>
@@ -1937,6 +1938,12 @@ static char *encode_command(char *p)
return(command); return(command);
} }
static void broken_pipe(int sig)
{
Msgptr = "BROKEN PIPE!";
MessageOn = MsgCount;
}
struct struct
{ {
FILE *vp; FILE *vp;
@@ -2012,6 +2019,7 @@ static bool raw_video_open()
break; break;
case 2: case 3: case 2: case 3:
signal(SIGPIPE, broken_pipe);
mencoderExists = (unsigned char)(int)(raw_vid.vp = popen(encode_command(md_command), WRITE_BINARY)); mencoderExists = (unsigned char)(int)(raw_vid.vp = popen(encode_command(md_command), WRITE_BINARY));
break; break;