udev: String substitutions can be done in ENV, too
[systemd_ALT.git] / src / basic / label.c
blobf134e7758965f5297f5dea018966391487ca3ac5
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
3 #include <errno.h>
4 #include <stddef.h>
6 #include "label.h"
8 static const LabelOps *label_ops = NULL;
10 int label_ops_set(const LabelOps *ops) {
11 if (label_ops)
12 return -EBUSY;
14 label_ops = ops;
15 return 0;
18 int label_ops_pre(int dir_fd, const char *path, mode_t mode) {
19 if (!label_ops || !label_ops->pre)
20 return 0;
22 return label_ops->pre(dir_fd, path, mode);
25 int label_ops_post(int dir_fd, const char *path) {
26 if (!label_ops || !label_ops->post)
27 return 0;
29 return label_ops->post(dir_fd, path);