forked from pool/systemd
bbba62be60
- Add or port upstream bugfix patches: 0001-Fix-systemd-stdio-bridge-symlink.patch 0002-execute-free-directory-path-if-we-fail-to-remove-it-.patch 0003-Do-not-print-invalid-UTF-8-in-error-messages.patch 0004-man-document-missing-options-of-systemd-run.patch 0005-systemd-run-add-some-extra-safety-checks.patch 0006-journal-assume-that-next-entry-is-after-previous-ent.patch 0007-journal-forget-file-after-encountering-an-error.patch 0008-core-correctly-unregister-PIDs-from-PID-hashtables.patch 0009-logind-fix-reference-to-systemd-user-sessions.servic.patch 0010-man-update-link-to-LSB.patch 0011-man-systemd-bootchart-fix-spacing-in-command.patch 0012-man-add-missing-comma.patch 0013-units-Do-not-unescape-instance-name-in-systemd-backl.patch - Add linker scripts as place holder of the old systemd shared libraries now all included in libsystemd.so (bnc#867128) - Make patch 1006-udev-always-rename-network.patch work again and add it again. - address missing owner functionality in systemd-tmpfiles (fate#314974) 1022-systemd-tmpfiles-ownerkeep.patch - Generate the bash completion files on the fly for the case of not having the package bash-completion around - Add or port upstream bugfix patches: 0001-nspawn-fix-detection-of-missing-proc-self-loginuid.patch 0002-cdrom_id-use-the-old-MMC-fallback.patch 0003-journalctl-refuse-extra-arguments-with-verify-and-si.patch OBS-URL: https://build.opensuse.org/request/show/225408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=177
111 lines
4.0 KiB
Diff
111 lines
4.0 KiB
Diff
---
|
|
rules/99-systemd.rules.in | 2 -
|
|
src/getty-generator/getty-generator.c | 2 -
|
|
src/shared/util.c | 62 ++++++++++++++++++++++++++++++++--
|
|
3 files changed, 61 insertions(+), 5 deletions(-)
|
|
|
|
--- systemd-208/rules/99-systemd.rules.in
|
|
+++ systemd-208/rules/99-systemd.rules.in 2014-02-05 10:34:17.346235540 +0000
|
|
@@ -7,7 +7,7 @@
|
|
|
|
ACTION=="remove", GOTO="systemd_end"
|
|
|
|
-SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*", TAG+="systemd"
|
|
+SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty*", TAG+="systemd"
|
|
|
|
KERNEL=="vport*", TAG+="systemd"
|
|
|
|
--- systemd-208/src/shared/util.c
|
|
+++ systemd-208/src/shared/util.c 2014-01-31 11:54:07.222235280 +0000
|
|
@@ -2967,6 +2967,7 @@ int status_vprintf(const char *status, b
|
|
struct iovec iovec[6] = {};
|
|
int n = 0;
|
|
static bool prev_ephemeral;
|
|
+ static int cached_on_tty = -1;
|
|
|
|
assert(format);
|
|
|
|
@@ -2980,6 +2981,51 @@ int status_vprintf(const char *status, b
|
|
if (fd < 0)
|
|
return fd;
|
|
|
|
+ if (_unlikely_(cached_on_tty < 0)) {
|
|
+ cached_on_tty = isatty(fd) > 0;
|
|
+ if (cached_on_tty) {
|
|
+ const char *e = getenv("TERM");
|
|
+ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) {
|
|
+ char *mode = NULL;
|
|
+ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL);
|
|
+ if (r < 0 || !mode || !streq(mode, "3270"))
|
|
+ cached_on_tty = 0;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (status && !cached_on_tty) {
|
|
+ const char *esc, *ptr;
|
|
+ esc = strchr(status, 0x1B);
|
|
+ if (esc && (ptr = strpbrk(esc, "SOFDTI*"))) {
|
|
+ switch(*ptr) {
|
|
+ case 'S':
|
|
+ status = " SKIP ";
|
|
+ break;
|
|
+ case 'O':
|
|
+ status = " OK ";
|
|
+ break;
|
|
+ case 'F':
|
|
+ status = "FAILED";
|
|
+ break;
|
|
+ case 'D':
|
|
+ status = "DEPEND";
|
|
+ break;
|
|
+ case 'T':
|
|
+ status = " TIME ";
|
|
+ break;
|
|
+ case 'I':
|
|
+ status = " INFO ";
|
|
+ break;
|
|
+ case '*':
|
|
+ status = " BUSY ";
|
|
+ break;
|
|
+ default:
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
if (ellipse) {
|
|
char *e;
|
|
size_t emax, sl;
|
|
@@ -3002,8 +3048,12 @@ int status_vprintf(const char *status, b
|
|
}
|
|
}
|
|
|
|
- if (prev_ephemeral)
|
|
- IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
|
|
+ if (prev_ephemeral) {
|
|
+ if (cached_on_tty)
|
|
+ IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE);
|
|
+ else
|
|
+ IOVEC_SET_STRING(iovec[n++], "\r");
|
|
+ }
|
|
prev_ephemeral = ephemeral;
|
|
|
|
if (status) {
|
|
@@ -3267,8 +3317,14 @@ void columns_lines_cache_reset(int signu
|
|
bool on_tty(void) {
|
|
static int cached_on_tty = -1;
|
|
|
|
- if (_unlikely_(cached_on_tty < 0))
|
|
+ if (_unlikely_(cached_on_tty < 0)) {
|
|
cached_on_tty = isatty(STDOUT_FILENO) > 0;
|
|
+ if (cached_on_tty) {
|
|
+ const char *e = getenv("TERM");
|
|
+ if (e && (strcmp(e, "dumb") == 0))
|
|
+ cached_on_tty = 0;
|
|
+ }
|
|
+ }
|
|
|
|
return cached_on_tty;
|
|
}
|