return unified_cache >= CGROUP_UNIFIED_ALL;
}
-#if 0 /// UNNEEDED by elogind
int cg_hybrid_unified(void) {
int r;
return cg_unified_update();
}
+#if 0 /// UNNEEDED by elogind
int cg_enable_everywhere(CGroupMask supported, CGroupMask mask, const char *p) {
_cleanup_free_ char *fs = NULL;
CGroupController c;
* Since checking is expensive, cache a non-error result. */
r = proc_cmdline_get_bool("systemd.legacy_systemd_cgroup_controller", &b);
-#else
-bool cg_is_legacy_wanted(void) {
- return true;
/* The meaning of the kernel option is reversed wrt. to the return value
* of this function, hence the negation. */
- return (wanted = r > 0 ? !b : false);
- return (wanted = r > 0 ? b : false);
-}
-
-bool cg_is_legacy_systemd_controller_wanted(void) {
- return cg_is_legacy_wanted() && !cg_is_unified_systemd_controller_wanted();
return (wanted = r > 0 ? !b : is_default);
}
+#else
+bool cg_is_legacy_wanted(void) {
+ return true;
+}
#endif // 0
#if 0 /// UNNEEDED by elogind
}
expanded_value = replace_env(value, *env,
- REPLACE_ENV_USE_ENVIRONMENT|REPLACE_ENV_ALLOW_BRACELESS);
+ REPLACE_ENV_USE_ENVIRONMENT|
+ REPLACE_ENV_ALLOW_BRACELESS|
+ REPLACE_ENV_ALLOW_EXTENDED);
if (!expanded_value)
return -ENOMEM;
const char *fname) {
/* NOTE: this function supports braceful and braceless variable expansions,
- * unlike other exported parsing functions.
+ * plus "extended" substitutions, unlike other exported parsing functions.
*/
return parse_env_file_internal(f, fname, NEWLINE, merge_env_file_push, env, NULL);
int load_env_file_pairs(FILE *f, const char *fname, const char *separator, char ***l);
#if 0 /// UNNEEDED by elogind
+int merge_env_file(char ***env, FILE *f, const char *fname);
+
int write_env_file(const char *fname, char **l);
int executable_is_script(const char *path, char **interpreter);
return -ENOMEM;
}
- *ret = done;
- done = NULL;
+ if (ret) {
+ *ret = done;
+ done = NULL;
+ }
return exists;
}
/***
- This file is part of elogind.
+ This file is part of systemd.
Copyright 2016 Lennart Poettering
- elogind is free software; you can redistribute it and/or modify it
+ systemd is free software; you can redistribute it and/or modify it
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.
- elogind is distributed in the hope that it will be useful, but
+ 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 elogind; If not, see <http://www.gnu.org/licenses/>.
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <linux/if_alg.h>
copy->fd = -1;
copy->algorithm = strdup(h->algorithm);
- if (!copy)
+ if (!copy->algorithm)
return -ENOMEM;
copy->fd = accept4(h->fd, NULL, 0, SOCK_CLOEXEC);
#pragma once
/***
- This file is part of elogind.
+ This file is part of systemd.
Copyright 2016 Lennart Poettering
- elogind is free software; you can redistribute it and/or modify it
+ systemd is free software; you can redistribute it and/or modify it
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.
- elogind is distributed in the hope that it will be useful, but
+ 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 elogind; If not, see <http://www.gnu.org/licenses/>.
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <inttypes.h>
#endif
}
#endif // 0
+
/* ======================================================================= */
#if !HAVE_DECL_RENAMEAT2