sysevent.c revision 18c2aff776a775d34a4c9893a4c72e0434d68e36
/***************************************************************************
*
* sysevent.c : Solaris sysevents
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*
**************************************************************************/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <libdevinfo.h>
#include <libsysevent.h>
#include <glib.h>
#include "../osspec.h"
#include "../logger.h"
#include "../hald.h"
#include "../hald_dbus.h"
#include "../device_info.h"
#include "../util.h"
#include "osspec_solaris.h"
#include "hotplug.h"
#include "devinfo.h"
#include "devinfo_storage.h"
#include "sysevent.h"
#ifndef ESC_LOFI
#define ESC_LOFI "lofi"
#endif
static void sysevent_dev_handler(sysevent_t *);
static void sysevent_dev_branch(gchar *);
static sysevent_handle_t *shp;
static int sysevent_pipe_fds[2];
static GIOChannel *sysevent_iochannel;
static guint sysevent_source_id;
sysevent_init(void)
{
const char *subcl[2];
/*
* pipe used to serialize sysevents through the main loop
*/
if (pipe (sysevent_pipe_fds) != 0) {
return (FALSE);
}
if (sysevent_iochannel == NULL) {
HAL_INFO (("g_io_channel_unix_new failed"));
return (FALSE);
}
return (FALSE);
}
return (FALSE);
}
return (FALSE);
}
subcl[0] = ESC_DEV_BRANCH_REMOVE;
return (FALSE);
}
return (B_TRUE);
}
void
sysevent_fini(void)
{
}
static void
{
char *class;
char *subclass;
char *phys_path;
char *dev_name;
char s[1024];
return;
return;
return;
goto out;
dev_name = "";
snprintf(s, sizeof (s), "%s %s %s %s\n",
out:
}
static gboolean
{
int matches;
HAL_INFO (("sysevent_iochannel_data"));
&err) == G_IO_STATUS_NORMAL) {
if (len == 0) {
break;
}
g_free (s);
s = NULL;
if (matches < 3) {
continue;
}
}
}
}
}
if (err) {
g_error_free (err);
}
return (TRUE);
}
static void
{
return;
}
}
static void
{
}
static void
{
}
static void
{
const char *parent_udi;
if ((d = hal_device_store_match_key_value_string (hald_get_gdl (),
return;
}
return;
}
return;
}
return;
}
}
static void
{
}