#include <errno.h>
#include <ctype.h>
+#include "libsysfs/sysfs/libsysfs.h"
#include "udev.h"
#include "udev_version.h"
#include "logging.h"
#include "namedev.h"
-#include "libsysfs/libsysfs.h"
/* global variables */
char sysfs_path[SYSFS_PATH_MAX];
char default_owner_str[OWNER_SIZE];
char default_group_str[GROUP_SIZE];
int udev_log;
+int udev_sleep;
static int string_is_true(char *str)
strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
udev_log = string_is_true(UDEV_LOG_DEFAULT);
+
+ udev_sleep = 1;
+ if (getenv("UDEV_NO_SLEEP") != NULL)
+ udev_sleep = 0;
}
#define set_var(_name, _var) \
if (strcasecmp(variable, _name) == 0) { \
dbg_parse("%s = '%s'", _name, value); \
- strncpy(_var, value, sizeof(_var)); \
+ strnfieldcpy(_var, value, sizeof(_var));\
}
#define set_bool(_name, _var) \