summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
47ae720)
https://bugs.freedesktop.org/show_bug.cgi?id=39386
* rename "userspace" to "core-os"
* rename "userspace" to "core-os"
-* append ".service" to unit names without any suffix (https://bugs.freedesktop.org/show_bug.cgi?id=39386)
-
-* journalctl: add --priority switch
-
* systemctl: "Journal has been rotated since unit was started." message is misleading
* syscall filter: add knowledge about compat syscalls
* systemctl: "Journal has been rotated since unit was started." message is misleading
* syscall filter: add knowledge about compat syscalls
char *unit_name_mangle(const char *name) {
char *r, *t;
const char *f;
char *unit_name_mangle(const char *name) {
char *r, *t;
const char *f;
/* We'll only escape the obvious characters here, to play
* safe. */
/* We'll only escape the obvious characters here, to play
* safe. */
- r = new(char, strlen(name) * 4 + 1);
+ r = new(char, strlen(name) * 4 + 1 + sizeof(".service")-1);
if (!r)
return NULL;
for (f = name, t = r; *f; f++) {
if (!r)
return NULL;
for (f = name, t = r; *f; f++) {
+ if (*f == '.')
+ dot = true;
+
if (*f == '/')
*(t++) = '-';
else if (!strchr("@" VALID_CHARS, *f))
if (*f == '/')
*(t++) = '-';
else if (!strchr("@" VALID_CHARS, *f))
+ if (!dot)
+ strcpy(t, ".service");
+ else
+ *t = 0;