chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
rule-generator: net - whitelist NICs that violate MAC local scheme
[elogind.git]
/
udev
/
lib
/
libudev-util.c
diff --git
a/udev/lib/libudev-util.c
b/udev/lib/libudev-util.c
index 243a99dce951c6dcd1cff5bbd77d86c0fb1a101f..2b8cda59f6e30cb41b2d6c6bfee3732f5051fe45 100644
(file)
--- a/
udev/lib/libudev-util.c
+++ b/
udev/lib/libudev-util.c
@@
-461,3
+461,16
@@
void util_set_fd_cloexec(int fd)
flags |= FD_CLOEXEC;
fcntl(fd, F_SETFD, flags);
}
+
+unsigned int util_string_hash32(const char *str)
+{
+ unsigned int hash = 0;
+
+ while (str[0] != '\0') {
+ hash += str[0] << 4;
+ hash += str[0] >> 4;
+ hash *= 11;
+ str++;
+ }
+ return hash;
+}