systemd: merge branch systemd into master

This commit is contained in:
Beniamino Galvani
2019-07-05 09:11:40 +02:00
44 changed files with 1013 additions and 490 deletions

View File

@@ -118,10 +118,8 @@ int mkfs_exists(const char *fstype);
_slash && ((*_slash = 0), true); \
_slash = strrchr((prefix), '/'))
char *prefix_root(const char *root, const char *path);
/* Similar to prefix_root(), but returns an alloca() buffer, or
* possibly a const pointer into the path parameter */
/* Similar to path_join(), but only works for two components, and only the first one may be NULL and returns
* an alloca() buffer, or possibly a const pointer into the path parameter. */
#define prefix_roota(root, path) \
({ \
const char* _path = (path), *_root = (root), *_ret; \
@@ -129,7 +127,7 @@ char *prefix_root(const char *root, const char *path);
size_t _l; \
while (_path[0] == '/' && _path[1] == '/') \
_path ++; \
if (empty_or_root(_root)) \
if (isempty(_root)) \
_ret = _path; \
else { \
_l = strlen(_root) + 1 + strlen(_path) + 1; \