chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mount: create directory before adding watches on it
[elogind.git]
/
src
/
core
/
unit-printf.c
diff --git
a/src/core/unit-printf.c
b/src/core/unit-printf.c
index 4e18afab8bb62f989d3acd111657f6641a1bbec7..62599d0813bd2478ace3c0a95f51cbff374f9a7d 100644
(file)
--- a/
src/core/unit-printf.c
+++ b/
src/core/unit-printf.c
@@
-182,7
+182,7
@@
static int specifier_user_name(char specifier, void *data, void *userdata, char
char *printed = NULL;
Unit *u = userdata;
ExecContext *c;
char *printed = NULL;
Unit *u = userdata;
ExecContext *c;
- int r;
+ int r
= 0
;
assert(u);
assert(u);
@@
-208,7
+208,7
@@
static int specifier_user_name(char specifier, void *data, void *userdata, char
if (r < 0)
return -ENODATA;
if (r < 0)
return -ENODATA;
-
asprintf(&printed, "%lu", (unsigned long)
uid);
+
r = asprintf(&printed, UID_FMT,
uid);
}
}
}
}
@@
-231,10
+231,10
@@
static int specifier_user_name(char specifier, void *data, void *userdata, char
if (specifier == 'u')
printed = strdup(username);
else
if (specifier == 'u')
printed = strdup(username);
else
-
asprintf(&printed, "%lu", (unsigned long)
uid);
+
r = asprintf(&printed, UID_FMT,
uid);
}
}
- if (!printed)
+ if (
r < 0 ||
!printed)
return -ENOMEM;
*ret = printed;
return -ENOMEM;
*ret = printed;
@@
-369,7
+369,7
@@
int unit_full_printf(Unit *u, const char *format, char **ret) {
/* This is similar to unit_name_printf() but also supports
* unescaping. Also, adds a couple of additional codes:
*
/* This is similar to unit_name_printf() but also supports
* unescaping. Also, adds a couple of additional codes:
*
- * %f the
the
instance if set, otherwise the id
+ * %f the instance if set, otherwise the id
* %c cgroup path of unit
* %r where units in this slice are placed in the cgroup tree
* %R the root of this systemd's instance tree
* %c cgroup path of unit
* %r where units in this slice are placed in the cgroup tree
* %R the root of this systemd's instance tree