chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] udev - safer string handling - part two
[elogind.git]
/
udev_config.c
diff --git
a/udev_config.c
b/udev_config.c
index 34ef82b8812c24220819c9ff9f85ab923fa0fa22..de83ef9c4c770160ae52645695fe09bec2379686 100644
(file)
--- a/
udev_config.c
+++ b/
udev_config.c
@@
-32,11
+32,11
@@
#include <errno.h>
#include <ctype.h>
#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 "udev.h"
#include "udev_version.h"
#include "logging.h"
#include "namedev.h"
-#include "libsysfs/libsysfs.h"
/* global variables */
char sysfs_path[SYSFS_PATH_MAX];
/* global variables */
char sysfs_path[SYSFS_PATH_MAX];
@@
-49,6
+49,7
@@
char default_mode_str[MODE_SIZE];
char default_owner_str[OWNER_SIZE];
char default_group_str[GROUP_SIZE];
int udev_log;
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)
static int string_is_true(char *str)
@@
-71,12
+72,16
@@
static void init_variables(void)
strfieldcpy(udev_rules_filename, UDEV_RULES_FILE);
strfieldcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
udev_log = string_is_true(UDEV_LOG_DEFAULT);
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); \
}
#define set_var(_name, _var) \
if (strcasecmp(variable, _name) == 0) { \
dbg_parse("%s = '%s'", _name, value); \
- strn
cpy(_var, value, sizeof(_var));
\
+ strn
fieldcpy(_var, value, sizeof(_var));
\
}
#define set_bool(_name, _var) \
}
#define set_bool(_name, _var) \