udev_add.c revision e5e322bc627a07d29a07e08f7c96bd644a3ae057
f1d075ff06de4d0cbf99acd36f0fcadd50d221beChristian Hesse * Userspace devfs
c97e8d10fe35ab282725deb3e05542a598e46cb1Kay Sievers * Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
3396c37f91a1a62d65b9dc5251246678a5cd381fKay Sievers * This program is free software; you can redistribute it and/or modify it
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <grp.h>
#include "libsysfs/sysfs/libsysfs.h"
#include "udev_libc_wrapper.h"
#include "udev.h"
#include "udev_utils.h"
#include "udev_sysfs.h"
#include "udev_version.h"
#include "logging.h"
#include "udev_rules.h"
#include "udev_db.h"
#include "udev_selinux.h"
int udev_make_node(struct udevice *udev, const char *file, dev_t devt, mode_t mode, uid_t uid, gid_t gid)
int retval = 0;
goto create;
goto perms;
case DEV_BLOCK:
case DEV_CLASS:
return -EINVAL;
if (retval != 0) {
goto exit;
goto exit;
goto exit;
exit:
return retval;
int tail;
uid = 0;
char *endptr;
unsigned long id;
gid = 0;
char *endptr;
unsigned long id;
goto error;
int range;
if (attr) {
int retval;
tail = 0;
if (retval != 0)
int sk;
int retval;
if (sk < 0) {
if (retval != 0)
return retval;
char *pos;
int retval = 0;
selinux_init();
if (retval != 0)
goto exit;
if (retval != 0)
goto exit;
exit:
selinux_exit();
return retval;