X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=mount.c;h=325f2d51e56be54cd916707fe7d583190ed96eb9;hb=1a63a750108b280070ed43e0dc02adb2c99c97cb;hp=728f3a25e4d49dcc40e79a7346338d6af0801b21;hpb=f94ea366d38fed424200b748cb042ca44f8c8d50;p=elogind.git
diff --git a/mount.c b/mount.c
index 728f3a25e..325f2d51e 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;
@@ -233,6 +252,8 @@ 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_dbus_queue(u);
+
return 0;
fail:
@@ -451,7 +472,7 @@ void mount_fd_event(Manager *m, int events) {
const UnitVTable mount_vtable = {
.suffix = ".mount",
- .init = unit_load_fragment_and_dropin,
+ .init = unit_load_fragment_and_dropin_optional,
.done = mount_done,
.coldplug = mount_coldplug,