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] add scripts to run gcov for udev from Leann Ogasawara <ogasawara@osdl.org>
[elogind.git]
/
udevstart.c
diff --git
a/udevstart.c
b/udevstart.c
index 21fd93df742b12776664bb10a4ebae1f5c23c11c..5e6606d535ac4fc5de658a3f3c5b2f08ffb35ee0 100644
(file)
--- a/
udevstart.c
+++ b/
udevstart.c
@@
-29,8
+29,11
@@
#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
@@
-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(devpath, "DEVPATH="
);
+
strfieldcat(devpath, 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,11
+181,6
@@
static int udev_scan(void)
}
}
}
}
}
}
-
- if (retval > 0)
- retval = 0;
-
- return -retval;
}
}
@@
-191,5
+188,7
@@
int main(int argc, char *argv[], char *envp[])
{
init_logging("udevstart");
{
init_logging("udevstart");
- return udev_scan();
+ udev_scan();
+
+ return 0;
}
}