- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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
(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
- if ((r = mount(what, where, NULL, MS_BIND|MS_REC, NULL)) >= 0) {
+ r = mount(what, where, NULL, MS_BIND|MS_REC, NULL);
+ if (r >= 0) {
log_debug("Successfully mounted %s to %s", what, where);
/* The bind mount will always inherit the original
log_debug("Successfully mounted %s to %s", what, where);
/* The bind mount will always inherit the original
/* Avoid exponential growth of trees */
if (r >= 0 && path_equal(p->path, "/"))
/* Avoid exponential growth of trees */
if (r >= 0 && path_equal(p->path, "/"))
- r = mount(NULL, where, NULL, MS_REMOUNT|MS_BIND|MS_UNBINDABLE|flags, NULL);
+ r = mount(NULL, where, NULL, MS_REMOUNT|MS_BIND|flags, NULL);
- for (p = paths; p < paths + n; p++)
- if ((r = apply_mount(p, root_dir, inaccessible_dir, private_dir, flags)) < 0)
+ for (p = paths; p < paths + n; p++) {
+ r = apply_mount(p, root_dir, inaccessible_dir, private_dir, flags);
+ if (r < 0)
memcpy(old_root_dir, tmp_dir, sizeof(tmp_dir)-1);
if (!mkdtemp(old_root_dir)) {
memcpy(old_root_dir, tmp_dir, sizeof(tmp_dir)-1);
if (!mkdtemp(old_root_dir)) {
t = old_root_dir + sizeof(root_dir) - 1;
if (umount2(t, MNT_DETACH) < 0)
/* At this point it's too late to turn anything back,
t = old_root_dir + sizeof(root_dir) - 1;
if (umount2(t, MNT_DETACH) < 0)
/* At this point it's too late to turn anything back,