Tue Dec 20 16:03:29 2005  Soeren Sandmann  <sandmann@redhat.com>

	* TODO: Updates

	* sysprof-text.c (main): Make it try and load the module before
	complaining.
This commit is contained in:
Soeren Sandmann
2005-12-20 20:51:39 +00:00
committed by Søren Sandmann Pedersen
parent ad5ffd749b
commit c5172c58e6
4 changed files with 53 additions and 30 deletions

View File

@ -176,9 +176,28 @@ open_fd (Collector *collector,
fd = open (SYSPROF_FILE, O_RDONLY);
if (fd < 0)
{
load_module();
fd = open (SYSPROF_FILE, O_RDONLY);
if (load_module())
{
GTimer *timer = g_timer_new ();
while (fd < 0 && g_timer_elapsed (timer, NULL) < 0.5)
{
usleep (100000);
g_print ("open\n");
fd = open (SYSPROF_FILE, O_RDONLY);
}
g_timer_destroy (timer);
if (fd < 0)
{
/* FIXME: set "module is loaded but no file error" */
}
}
/* Wait for udev to discover the new device */
if (fd < 0)
{