[systemd-devel] [PATCH 02/11] Use valid symlink for serial /dev/3270/tty1 in systemd-getty-generator
Werner Fink
werner at suse.de
Fri Jun 13 07:41:01 PDT 2014
Otherwise the add_symlink() function tries to make directories for each
slash even for the slash after the @ symbol in the final link name.
---
src/getty-generator/getty-generator.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git src/getty-generator/getty-generator.c src/getty-generator/getty-generator.c
index 6a4aa2c..5ee0bf0 100644
--- src/getty-generator/getty-generator.c
+++ src/getty-generator/getty-generator.c
@@ -67,6 +67,7 @@ static int add_symlink(const char *fservice, const char *tservice) {
static int add_serial_getty(const char *tty) {
_cleanup_free_ char *n = NULL;
+ char *at;
assert(tty);
@@ -76,6 +77,14 @@ static int add_serial_getty(const char *tty) {
if (!n)
return log_oom();
+ if ((at = strchr(n, '@'))) {
+ char *sl;
+ while (*(++at) && (sl = strchr(at, '/'))) {
+ *sl = '-';
+ at = sl;
+ }
+ }
+
return add_symlink("serial-getty at .service", n);
}
--
1.7.9.2
More information about the systemd-devel
mailing list