Remove ref-counting since it didn't actually do any good.

Wed May 18 22:21:52 2005  Søren Sandmann  <sandmann@redhat.com>

        * module/sysprof-module.c: Remove ref-counting since it didn't
        actually do any good.

        * sysprof.c (load_module): Use g_spawn_command_line_sync() instaed
        of system().
This commit is contained in:
Søren Sandmann
2005-05-19 02:27:18 +00:00
committed by Søren Sandmann Pedersen
parent 720e07109c
commit d9de1e5a36
4 changed files with 49 additions and 62 deletions

View File

@ -27,6 +27,8 @@
#include <glade/glade.h>
#include <errno.h>
#include <glib/gprintf.h>
#include <sys/wait.h>
#include <sys/types.h>
#include "binfile.h"
#include "watch.h"
@ -471,13 +473,25 @@ sorry (GtkWidget *parent_window,
gtk_widget_destroy (dialog);
}
static gboolean
load_module (void)
{
int retval = system ("/sbin/modprobe sysprof-module");
int exit_status = -1;
char *dummy1, *dummy2;
return (retval == 0);
if (g_spawn_command_line_sync ("/sbin/modprobe sysprof-module",
&dummy1, &dummy2,
&exit_status,
NULL))
{
if (WIFEXITED (exit_status))
exit_status = WEXITSTATUS (exit_status);
g_free (dummy1);
g_free (dummy2);
}
return (exit_status == 0);
}
static void