udev: use startswith() and streq()

This commit is contained in:
Kay Sievers
2012-04-16 20:54:17 +02:00
parent 6ada823a9a
commit 33502ffe2e
18 changed files with 143 additions and 134 deletions
+2 -1
View File
@@ -21,6 +21,7 @@
#include <sys/epoll.h>
#include "libudev.h"
#include "util.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -474,7 +475,7 @@ int main(int argc, char *argv[])
}
/* add sys path if needed */
if (strncmp(syspath, "/sys", strlen("/sys")) != 0) {
if (!startswith(syspath, "/sys")) {
snprintf(path, sizeof(path), "/sys/%s", syspath);
syspath = path;
}