diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-15 13:00:58 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-15 13:00:58 +0200 |
commit | 7913b00daa6c95f4a8fdbc96793dc08f26a5f121 (patch) | |
tree | 7f3f93fed911b2380f8f869e1e5617e8cc55bcc7 /thread.h | |
parent | 37754870e0868f41549c63941ed4a236751e70e4 (diff) | |
download | vdr-7913b00daa6c95f4a8fdbc96793dc08f26a5f121.tar.gz vdr-7913b00daa6c95f4a8fdbc96793dc08f26a5f121.tar.bz2 |
Pipe to Dolby Digital replay command closes all unused file descriptors to avoid crashing when OSD is on
Diffstat (limited to 'thread.h')
-rw-r--r-- | thread.h | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -4,13 +4,14 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.h 1.8 2001/08/05 10:36:47 kls Exp $ + * $Id: thread.h 1.9 2001/09/15 12:46:52 kls Exp $ */ #ifndef __THREAD_H #define __THREAD_H #include <pthread.h> +#include <stdio.h> #include <sys/types.h> class cMutex; @@ -88,4 +89,19 @@ public: #define LOCK_THREAD cThreadLock ThreadLock(this) +// cPipe implements a pipe that closes all unnecessary file descriptors in +// the child process. + +class cPipe { +private: + pid_t pid; + FILE *f; +public: + cPipe(void); + ~cPipe(); + operator FILE* () { return f; } + bool Open(const char *Command, const char *Mode); + int Close(void); + }; + #endif //__THREAD_H |