mpv/mpvcore
wm4 9d8573cfe8 Prevent creating zombies
The "run" input command does fork+exec to spawn child processes. But it
doesn't cleanup the child processes, so they are left as zombies until
mpv terminates. Leaving zombie processes around is not very nice, so
employ a simple trick to let pid 1 take care of this: we fork twice, and
when the first fork exits, the second fork becomes orphaned and becomes
pid 1's child. It becomes pid 1's responsibility to cleanup the process.
The advantage is that we don't need extra logic to cleanup the spawned
process, which could have an arbitrary lifetime.

This is e.g. described here: http://yarchive.net/comp/zombie_process.html

Also use _exit() instead of exit(). It's not really sane to run cleanup
handlers (atexit() etc.) inside a forked process.
2013-11-30 22:47:26 +01:00
..
input Use O_CLOEXEC when creating FDs 2013-11-30 22:40:51 +01:00
player Prevent creating zombies 2013-11-30 22:47:26 +01:00
asxparser.c
asxparser.h
av_common.c video: refactor PTS code, add fall back heuristic to DTS 2013-11-27 21:14:39 +01:00
av_common.h video: refactor PTS code, add fall back heuristic to DTS 2013-11-27 21:14:39 +01:00
av_log.c
av_log.h
av_opts.c
av_opts.h
bstr.c
bstr.h
charset_conv.c
charset_conv.h
codecs.c
codecs.h
cpudetect.c
cpudetect.h
encode.h
encode_lavc.c Take care of some libavutil deprecations, drop support for FFmpeg 1.0 2013-11-29 17:39:57 +01:00
encode_lavc.h Take care of some libavutil deprecations, drop support for FFmpeg 1.0 2013-11-29 17:39:57 +01:00
m_config.c
m_config.h
m_option.c
m_option.h input: use separate type for command definitions 2013-11-28 19:04:16 +01:00
m_property.c
m_property.h
mp_common.c
mp_common.h Reduce stheader.h includes, move stream types to mp_common.h 2013-11-23 22:08:42 +01:00
mp_memory_barrier.h
mp_msg.c
mp_msg.h
mp_ring.c
mp_ring.h
mp_talloc.h
mpv_global.h
options.c build: make pthreads mandatory 2013-11-28 19:28:38 +01:00
options.h
parser-cfg.c
parser-cfg.h
parser-mpcmd.c
parser-mpcmd.h
path.c
path.h
playlist.c
playlist.h
playlist_parser.c
playlist_parser.h
resolve.h
resolve_quvi.c
resolve_quvi9.c
version.c