memfd: don't open kdbus for memfd

No reason to open /dev/kdbus/control if we want memfds. memfd_create() is
always available.
This commit is contained in:
David Herrmann
2014-08-18 12:57:55 +02:00
parent 7e2ce386ca
commit 302e4b4963
-5
View File
@@ -39,16 +39,11 @@ struct sd_memfd {
int sd_memfd_new(sd_memfd **m, const char *name) {
_cleanup_close_ int kdbus = -1;
_cleanup_free_ char *g = NULL;
sd_memfd *n;
assert_return(m, -EINVAL);
kdbus = open("/dev/kdbus/control", O_RDWR|O_NOCTTY|O_CLOEXEC);
if (kdbus < 0)
return -errno;
if (name) {
/* The kernel side is pretty picky about the character
* set here, let's do the usual bus escaping to deal