X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=mount.c;h=74094cc5149713f529a37d481f762c7b21de1111;hp=a1c33442c0470bf7148ae658689ec27fb0551833;hb=2e6c9e6bdee8ebc9d34095b6f542603a217498e0;hpb=ef734fd6c2ec4e5602bbfe2a0d26dcf39c14d2bf diff --git a/mount.c b/mount.c index a1c33442c..74094cc51 100644 --- a/mount.c +++ b/mount.c @@ -1,5 +1,24 @@ /*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*** + This file is part of systemd. + + Copyright 2010 Lennart Poettering + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with systemd; If not, see . +***/ + #include #include #include @@ -106,7 +125,7 @@ static int mount_add_node_links(Mount *m) { if (!path_startswith(m->what, "/dev/")) return 0; - if (!(e = unit_name_escape_path("node-", m->what+1, ".device"))) + if (!(e = unit_name_escape_path(m->what+1, ".device"))) return -ENOMEM; r = manager_load_unit(UNIT(m)->meta.manager, e, &device); @@ -140,7 +159,7 @@ static int mount_add_path_links(Mount *m) { n = (Mount*) other; if (n == m) - return 0; + continue; if (path_startswith(m->where, n->where)) { @@ -178,9 +197,9 @@ static int mount_add_one(Manager *m, const char *what, const char *where, bool l return 0; if (streq(where, "/")) - e = strdup("rootfs.mount"); + e = strdup("-.mount"); else - e = unit_name_escape_path("fs-", where+1, ".mount"); + e = unit_name_escape_path(where+1, ".mount"); if (!e) return -ENOMEM; @@ -208,6 +227,7 @@ static int mount_add_one(Manager *m, const char *what, const char *where, bool l if ((r = unit_set_description(u, where)) < 0) goto fail; + unit_add_to_load_queue(u); } else { delete = false; free(e); @@ -232,7 +252,7 @@ static int mount_add_one(Manager *m, const char *what, const char *where, bool l if ((r = mount_add_path_links(MOUNT(u))) < 0) goto fail; - unit_add_to_load_queue(u); + unit_add_to_dbus_queue(u); return 0; @@ -420,7 +440,7 @@ void mount_fd_event(Manager *m, int events) { int r; assert(m); - assert(events == POLLERR); + assert(events == EPOLLERR); /* The manager calls this for every fd event happening on the * /proc/self/mountinfo file, which informs us about mounting