test-udev.c revision e598c5738c2dc85a3e93c3f68cd88e8eea51215b
/*
* Copyright (C) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <ctype.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <syslog.h>
#include <grp.h>
#include "udev.h"
#include "udev_rules.h"
{
switch (signum) {
case SIGALRM:
exit(1);
case SIGINT:
case SIGTERM:
}
}
{
struct sysfs_device *dev;
struct udev_rules rules;
const char *action;
const char *devpath;
const char *subsystem;
exit(1);
/* set signal handlers */
/* trigger timeout to prevent hanging processes */
/* older kernels passed the SUBSYSTEM only as argument */
goto exit;
}
/* export log_priority , as called programs may want to do the same as udev */
if (udev_get_log_priority(udev) > 0) {
char priority[32];
}
sysfs_init();
goto fail;
}
goto fail;
/* override built-in sysfs device */
/* get dev_t from environment, which is needed for "remove" to work, "add" works also from sysfs */
else
if (udevice->event_timeout >= 0)
fail:
exit:
if (retval != 0)
return 1;
return 0;
}