import.c revision b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering This file is part of systemd.
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering Copyright 2015 Lennart Poettering
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering systemd is free software; you can redistribute it and/or modify it
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering under the terms of the GNU Lesser General Public License as published by
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering (at your option) any later version.
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering systemd is distributed in the hope that it will be useful, but
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering Lesser General Public License for more details.
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering You should have received a copy of the GNU Lesser General Public License
16e9f408fa9a9626059bdd6c89dc175e06b9e976Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
#include "verbs.h"
static bool arg_force = false;
static bool arg_read_only = false;
static int interrupt_signal_handler(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
if (error == 0)
int r, fd;
else if (path)
if (local) {
return log_oom();
return -EINVAL;
if (!arg_force) {
return -EEXIST;
if (path) {
if (open_fd < 0)
if (error == 0)
int r, fd;
else if (path)
if (local) {
return log_oom();
return -EINVAL;
if (!arg_force) {
return -EEXIST;
if (path) {
if (open_fd < 0)
case ARG_VERSION:
return version();
case ARG_FORCE:
arg_force = true;
case ARG_IMAGE_ROOT:
case ARG_READ_ONLY:
arg_read_only = true;
return -EINVAL;
log_open();
goto finish;