NULL,
};
+static int pakfire_on_root(Pakfire pakfire) {
+ return (strcmp(pakfire->path, "/") == 0);
+}
+
static const struct pakfire_mountpoint {
const char* source;
const char* target;
// Safety check in case this is being launched on the host system
static int pakfire_safety_checks(Pakfire pakfire) {
// Nothing to do if we are not working on root
- if (strcmp(pakfire->path, "/") != 0)
+ if (!pakfire_on_root(pakfire))
return 0;
if (strcmp(pakfire->distro.id, "ipfire") != 0) {
}
PAKFIRE_EXPORT int pakfire_copy_in(Pakfire pakfire, const char* src, const char* dst) {
- if (strcmp(pakfire->path, "/") == 0) {
+ if (pakfire_on_root(pakfire)) {
errno = ENOTSUP;
return 1;
}
}
PAKFIRE_EXPORT int pakfire_copy_out(Pakfire pakfire, const char* src, const char* dst) {
- if (strcmp(pakfire->path, "/") == 0) {
+ if (pakfire_on_root(pakfire)) {
errno = ENOTSUP;
return 1;
}