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] DEVPATH for netdev
[elogind.git]
/
udevstart.c
diff --git
a/udevstart.c
b/udevstart.c
index 5c977b5ce65ab0ee92574391d188066814d1329a..7e19c379a503ed8ff7f2885dd419ffd236f3157b 100644
(file)
--- a/
udevstart.c
+++ b/
udevstart.c
@@
-29,12
+29,15
@@
#include <ctype.h>
#include <dirent.h>
#include <sys/wait.h>
#include <ctype.h>
#include <dirent.h>
#include <sys/wait.h>
+#include <sys/types.h>
+#include <unistd.h>
#include "logging.h"
#include "logging.h"
+#include "udev_lib.h"
#ifdef LOG
#ifdef LOG
-unsigned char logname[
42
];
+unsigned char logname[
LOGNAME_SIZE
];
void log_message(int level, const char *format, ...)
{
va_list args;
void log_message(int level, const char *format, ...)
{
va_list args;
@@
-59,8
+62,8
@@
static void udev_exec(const char *path, const char* subsystem)
char nosleep[] = "UDEV_NO_SLEEP=1";
char *env[] = { action, devpath, nosleep, NULL };
char nosleep[] = "UDEV_NO_SLEEP=1";
char *env[] = { action, devpath, nosleep, NULL };
- s
nprintf(devpath, MAX_PATHLEN, "DEVPATH=%s", path
);
-
devpath[MAX_PATHLEN-1] = '\0'
;
+ s
trcpy(action, "DEVPATH=%s"
);
+
strfieldcat(action, path)
;
pid = fork();
switch (pid) {
pid = fork();
switch (pid) {
@@
-78,12
+81,11
@@
static void udev_exec(const char *path, const char* subsystem)
}
}
}
}
-static
int
udev_scan(void)
+static
void
udev_scan(void)
{
char *devpath;
DIR *dir;
struct dirent *dent;
{
char *devpath;
DIR *dir;
struct dirent *dent;
- int retval = -EINVAL;
devpath = "block";
dir = opendir(SYSBLOCK);
devpath = "block";
dir = opendir(SYSBLOCK);
@@
-179,17
+181,14
@@
static int udev_scan(void)
}
}
}
}
}
}
-
- if (retval > 0)
- retval = 0;
-
- return -retval;
}
}
-int main(int argc, char *
*argv, char **envp
)
+int main(int argc, char *
argv[], char *envp[]
)
{
init_logging("udevstart");
{
init_logging("udevstart");
- return udev_scan();
+ udev_scan();
+
+ return 0;
}
}