您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unit_name_from_path函数代码示例

51自学网 2021-06-03 09:10:18
  C++
这篇教程C++ unit_name_from_path函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unit_name_from_path函数的典型用法代码示例。如果您正苦于以下问题:C++ unit_name_from_path函数的具体用法?C++ unit_name_from_path怎么用?C++ unit_name_from_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了unit_name_from_path函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: automount_verify

static int automount_verify(Automount *a) {        bool b;        char *e;        assert(a);        if (UNIT(a)->load_state != UNIT_LOADED)                return 0;        if (path_equal(a->where, "/")) {                log_error_unit(UNIT(a)->id, "Cannot have an automount unit for the root directory. Refusing.");                return -EINVAL;        }        e = unit_name_from_path(a->where, ".automount");        if (!e)                return -ENOMEM;        b = unit_has_name(UNIT(a), e);        free(e);        if (!b) {                log_error_unit(UNIT(a)->id, "%s's Where setting doesn't match unit name. Refusing.", UNIT(a)->id);                return -EINVAL;        }        return 0;}
开发者ID:ariscop,项目名称:systemd,代码行数:27,


示例2: automount_verify

static int automount_verify(Automount *a) {        _cleanup_free_ char *e = NULL;        int r;        assert(a);        if (UNIT(a)->load_state != UNIT_LOADED)                return 0;        if (path_equal(a->where, "/")) {                log_unit_error(UNIT(a), "Cannot have an automount unit for the root directory. Refusing.");                return -EINVAL;        }        r = unit_name_from_path(a->where, ".automount", &e);        if (r < 0)                return log_unit_error(UNIT(a), "Failed to generate unit name from path: %m");        if (!unit_has_name(UNIT(a), e)) {                log_unit_error(UNIT(a), "Where= setting doesn't match unit name. Refusing.");                return -EINVAL;        }        return 0;}
开发者ID:aulanov,项目名称:systemd,代码行数:25,


示例3: generator_hook_up_growfs

int generator_hook_up_growfs(                const char *dir,                const char *where,                const char *target) {        _cleanup_free_ char *unit = NULL, *escaped = NULL, *where_unit = NULL;        _cleanup_fclose_ FILE *f = NULL;        const char *unit_file;        int r;        escaped = cescape(where);        if (!escaped)                return log_oom();        r = unit_name_from_path_instance("systemd-growfs", where, ".service", &unit);        if (r < 0)                return log_error_errno(r, "Failed to make unit instance name from path /"%s/": %m",                                       where);        r = unit_name_from_path(where, ".mount", &where_unit);        if (r < 0)                return log_error_errno(r, "Failed to make unit name from path /"%s/": %m",                                       where);        unit_file = strjoina(dir, "/", unit);        log_debug("Creating %s", unit_file);        f = fopen(unit_file, "wxe");        if (!f)                return log_error_errno(errno, "Failed to create unit file %s: %m",                                       unit_file);        fprintf(f,                "# Automatically generated by %s/n/n"                "[Unit]/n"                "Description=Grow File System on %%f/n"                "Documentation=man:[email
C++ unit_remove_map函数代码示例
C++ unit_m4函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。