turbostat: remove prctl

This won't be reliable since our handlers are run on threads.
This commit is contained in:
Christian Hergert
2019-07-31 13:20:05 -07:00
parent f9f7e29e54
commit 5ff150d365

View File

@ -23,20 +23,13 @@
#include "sysprof-turbostat.h"
#include <errno.h>
#include <fcntl.h>
#include <glib-unix.h>
#include <math.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>
#ifdef __linux__
# include <sys/prctl.h>
#endif
struct _SysprofTurbostat
{
GPid pid;
@ -85,14 +78,6 @@ sysprof_turbostat_free (SysprofTurbostat *self)
g_rc_box_release_full (self, sysprof_turbostat_finalize);
}
static void
child_setup_cb (gpointer data)
{
#ifdef __linux__
prctl (PR_SET_PDEATHSIG, SIGTERM);
#endif
}
static gboolean
sysprof_turbostat_watch_cb (GIOChannel *channel,
GIOCondition cond,
@ -237,7 +222,7 @@ sysprof_turbostat_start (SysprofTurbostat *self,
(gchar **)argv,
env,
(G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL),
child_setup_cb,
NULL,
NULL,
&self->pid,
NULL,