diff options
author | Simon Rettberg | 2019-07-30 16:07:15 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-30 16:07:15 +0200 |
commit | 813ac136e48f60d4c2b13e808107870dafcc4d52 (patch) | |
tree | 396a6c98276f6e9a04216933daebdf3af7b81d46 /driver/windows.c | |
parent | Flush X events before locking if we have an external ungrab command (diff) | |
parent | Update to 5.43 (diff) | |
download | xscreensaver-813ac136e48f60d4c2b13e808107870dafcc4d52.tar.gz xscreensaver-813ac136e48f60d4c2b13e808107870dafcc4d52.tar.xz xscreensaver-813ac136e48f60d4c2b13e808107870dafcc4d52.zip |
Merge branch 'master' into openslx (5.43)
Diffstat (limited to 'driver/windows.c')
-rw-r--r-- | driver/windows.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/driver/windows.c b/driver/windows.c index ceba8c8..38a611b 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -1,5 +1,5 @@ /* windows.c --- turning the screen black; dealing with visuals, virtual roots. - * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski <jwz@jwz.org> + * xscreensaver, Copyright (c) 1991-2019 Jamie Zawinski <jwz@jwz.org> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -778,6 +778,16 @@ restore_real_vroot_handler (int sig) if (restore_real_vroot (si)) fprintf (real_stderr, "\n%s: %s intercepted, vroot restored.\n", blurb(), signal_name(sig)); +# ifdef HAVE_LIBSYSTEMD + if (si->systemd_pid) /* Kill background xscreensaver-systemd process */ + { + /* We're exiting, so there's no need to do a full kill_job() here, + which will waitpid(). */ + /* kill_job (si, si->systemd_pid, SIGTERM); */ + kill (si->systemd_pid, SIGTERM); + si->systemd_pid = 0; + } +# endif kill (getpid (), sig); } @@ -898,6 +908,14 @@ saver_exit (saver_info *si, int status, const char *dump_core_reason) if (p->verbose_p && vrs) fprintf (real_stderr, "%s: old vroot restored.\n", blurb()); +# ifdef HAVE_LIBSYSTEMD + if (si->systemd_pid) /* Kill background xscreensaver-systemd process */ + { + kill_job (si, si->systemd_pid, SIGTERM); + si->systemd_pid = 0; + } +# endif + fflush(real_stdout); #ifdef VMS /* on VMS, 1 is the "normal" exit code instead of 0. */ |