Commit b88ecc0a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

file output: unfix SIGPIPE blocking if POSIX RTS is unsupported

parent fe50471f
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
#ifndef O_LARGEFILE #ifndef O_LARGEFILE
# define O_LARGEFILE 0 # define O_LARGEFILE 0
#endif #endif
#ifndef _POSIX_REALTIME_SIGNALS
# define _POSIX_REALTIME_SIGNALS (-1)
#endif
#define SOUT_CFG_PREFIX "sout-file-" #define SOUT_CFG_PREFIX "sout-file-"
...@@ -103,7 +106,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer ) ...@@ -103,7 +106,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
return i_write; return i_write;
} }
#ifdef S_ISSOCK #if (_POSIX_REALTIME_SIGNALS > 0)
static ssize_t WritePipe(sout_access_out_t *access, block_t *block) static ssize_t WritePipe(sout_access_out_t *access, block_t *block)
{ {
int fd = (intptr_t)access->p_sys; int fd = (intptr_t)access->p_sys;
...@@ -156,7 +159,11 @@ static ssize_t WritePipe(sout_access_out_t *access, block_t *block) ...@@ -156,7 +159,11 @@ static ssize_t WritePipe(sout_access_out_t *access, block_t *block)
return total; return total;
} }
#else
# define WritePipe Write
#endif
#ifdef S_ISSOCK
static ssize_t Send(sout_access_out_t *access, block_t *block) static ssize_t Send(sout_access_out_t *access, block_t *block)
{ {
int fd = (intptr_t)access->p_sys; int fd = (intptr_t)access->p_sys;
...@@ -191,8 +198,6 @@ static ssize_t Send(sout_access_out_t *access, block_t *block) ...@@ -191,8 +198,6 @@ static ssize_t Send(sout_access_out_t *access, block_t *block)
} }
return total; return total;
} }
#else
# define WritePipe Write
#endif #endif
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment