remount-fs.c revision da927ba997d68401563b927f92e6e40e021a8e5c
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <mntent.h>
#include "log.h"
#include "util.h"
#include "path-util.h"
#include "set.h"
#include "mount-setup.h"
#include "exit-status.h"
* respected */
int ret = EXIT_FAILURE;
if (argc > 1) {
log_error("This program takes no argument.");
return EXIT_FAILURE;
}
log_open();
umask(0022);
if (!f) {
return EXIT_SUCCESS;
return EXIT_FAILURE;
}
if (!pids) {
log_error("Failed to allocate set");
goto finish;
}
ret = EXIT_SUCCESS;
int k;
char *s;
/* Remount the root fs, /usr and all API VFS */
continue;
if (pid < 0) {
log_error("Failed to fork: %m");
ret = EXIT_FAILURE;
continue;
}
if (pid == 0) {
const char *arguments[5];
/* Child */
}
/* Parent */
if (!s) {
log_oom();
ret = EXIT_FAILURE;
continue;
}
if (k < 0) {
log_error_errno(k, "Failed to add PID to set: %m");
ret = EXIT_FAILURE;
continue;
}
}
while (!hashmap_isempty(pids)) {
char *s;
continue;
log_error("waitid() failed: %m");
ret = EXIT_FAILURE;
break;
}
if (s) {
else
ret = EXIT_FAILURE;
}
free(s);
}
}
if (pids)
return ret;
}