1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 21:27:08 +00:00
mpv/osdep
llyyr f33a4d2fd9 terminal-unix: don't set SA_RESETHAND for SIGTERM/SIGQUIT
This can cause mpv to abruptly quit without following the proper uninit
process when a second `SIGTERM` or `SIGQUIT` is sent and mpv
didn't quit on the first one already. This is because the default action
for these signals is to terminate the program immediately, similar to
`SIGKILL`, and `SA_RESETHAND` resets the `quit_request_sighandler` to
`SIG_DFL` for the default action.

Also keep the `SA_RESETHAND` flag for SIGINT because the current
behavior is to quit after receiving two Ctrl+C no matter what, this is
probably convenient and worth keeping.

This change is because some tools (e.g. GNU timeout) send SIGTERM twice
after the timeout period.

An easy way to reproduce is with `timeout 1 mpv [...]` where mpv would
quit abruptly anywhere from half the time to once every 50 attempts
depending on your luck.
2024-01-14 23:10:50 +01:00
..
android osdep: remove posix_spawn() helpers and wrappers 2020-05-15 16:37:41 +02:00
macos mac: add support for drag-and-drop option 2023-12-15 16:59:52 +01:00
apple_utils.c osdep: move cfstr<->cstr conversions to a new apple_utils.c file 2023-06-25 11:01:58 +02:00
apple_utils.h osdep: move cfstr<->cstr conversions to a new apple_utils.c file 2023-06-25 11:01:58 +02:00
compiler.h audio: introduce ao_read_data_nonblocking() 2023-11-08 20:26:23 +01:00
endian.h
getpid.h
glob-win.c
io.c osdep: clarify and rename a constant on win32 2023-12-27 22:55:56 +01:00
io.h various: use correct PATH_MAX for win32 2023-12-27 22:55:56 +01:00
language-apple.c osdep: add mp_get_user_langs 2023-06-25 11:01:58 +02:00
language-posix.c language-posix: as a fallback, treat "C" as "en" 2023-07-25 11:34:06 +02:00
language-win.c osdep: add mp_get_user_langs 2023-06-25 11:01:58 +02:00
macOS_swift_bridge.h mac: add support for drag-and-drop option 2023-12-15 16:59:52 +01:00
macosx_application_objc.h mac: fix libmpv usage without embedding 2023-11-25 19:04:07 +01:00
macosx_application.h mac: cleanup some unused and unneeded code 2023-11-25 19:04:07 +01:00
macosx_application.m mac: fix libmpv usage without embedding 2023-11-25 19:04:07 +01:00
macosx_events_objc.h mac: fix media key support for libmpv users 2020-02-22 13:56:31 +01:00
macosx_events.h mac: remove Apple Remote support 2019-12-15 20:07:31 +01:00
macosx_events.m osdep/macosx: add default switch cases to suppress Wswitch 2023-11-24 10:05:09 +01:00
macosx_menubar_objc.h
macosx_menubar.h various: fix typos 2022-04-25 09:07:18 -04:00
macosx_menubar.m various: fix capitalization of 'GitHub' 2023-12-27 22:11:58 +01:00
macosx_touchbar.h mac: only update touch bar items when necessary 2021-02-13 15:51:32 +01:00
macosx_touchbar.m osdep/macosx: add default switch cases to suppress Wswitch 2023-11-24 10:05:09 +01:00
main-fn-cocoa.c
main-fn-unix.c
main-fn-win.c meson: adjust win32 defines 2023-11-25 12:38:20 +01:00
main-fn.h
meson.build Reapply "osdep/meson: add libplacebo include dir to swift compile" 2023-11-27 15:00:35 -06:00
mpv.exe.manifest win32: opt in to the windows segment heap 2023-12-22 16:36:31 +01:00
mpv.rc build: remove outdated generated directory 2023-07-31 19:00:06 +00:00
path-darwin.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
path-macosx.m
path-unix.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
path-uwp.c various: use correct PATH_MAX for win32 2023-12-27 22:55:56 +01:00
path-win.c various: use correct PATH_MAX for win32 2023-12-27 22:55:56 +01:00
path.h player: use XDG_CACHE_HOME by default 2023-05-09 20:37:17 +00:00
poll_wrapper.c vo: don't sleep 1ms always when requested time is in the past 2023-11-09 21:31:58 +00:00
poll_wrapper.h vo: use mp_poll wrapper in wait_events when applicable 2023-10-10 19:10:55 +00:00
semaphore_osx.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
semaphore.h ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
strnlen.h osdep: make use of HAVE_ANDROID 2018-08-20 17:16:22 +02:00
subprocess-dummy.c command: extend subprocess command 2020-07-20 21:02:17 +02:00
subprocess-posix.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
subprocess-win.c win32: don't jump over variable init with goto 2023-11-18 23:55:28 +00:00
subprocess.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
subprocess.h command: extend subprocess command stdin, change behavior 2020-08-16 02:54:44 +02:00
terminal-dummy.c osdep/terminal: Add function to get terminal pixel dimensions 2020-11-22 13:34:25 +02:00
terminal-unix.c terminal-unix: don't set SA_RESETHAND for SIGTERM/SIGQUIT 2024-01-14 23:10:50 +01:00
terminal-win.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
terminal.h osdep/terminal.h: Rename screen buffer controls 2022-12-20 10:26:53 +01:00
threads-posix.c threads: remove unused code 2023-11-05 17:36:17 +00:00
threads-posix.h osdep/threads-posix: use CLOCK_MONOTONIC if supported 2023-11-08 04:32:10 +00:00
threads-win32.h threads-win32: add comment about local decl of a function 2023-11-08 04:32:10 +00:00
threads.h threads: unbreak mpv on builds without asserts 2023-11-06 04:14:49 +00:00
timer-darwin.c timer: change mp_sleep_us to mp_sleep_ns 2023-10-10 19:10:55 +00:00
timer-linux.c osdep/timer-linux: check clock availability on init 2023-11-08 04:32:10 +00:00
timer-win32.c osdep/timer-win2: rename to timer-win32 2023-10-25 19:30:39 +00:00
timer.c timer: remove unused code 2023-11-05 17:36:17 +00:00
timer.h timer: remove unused code 2023-11-05 17:36:17 +00:00
w32_keyboard.c win32: properly handle WM_XBUTTONUP and WM_XBUTTONDOWN 2023-12-06 11:07:37 +01:00
w32_keyboard.h
win32-console-wrapper.c various: use correct PATH_MAX for win32 2023-12-27 22:55:56 +01:00
windows_utils.c various: sort some standard headers 2023-10-20 21:31:09 +02:00
windows_utils.h subprocess-win: update to mp_subprocess2 2020-07-20 21:02:17 +02:00