chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: monitor the inotify file descriptor not the console one in acquire_terminal()
[elogind.git]
/
src
/
basic
/
terminal-util.c
diff --git
a/src/basic/terminal-util.c
b/src/basic/terminal-util.c
index 215b764882b95dbde54dc09b599b0a948776de1f..98600f7a42f731d4a62e172c2b4f8e5cc622854a 100644
(file)
--- a/
src/basic/terminal-util.c
+++ b/
src/basic/terminal-util.c
@@
-347,12
+347,7
@@
int open_terminal(const char *name, int mode) {
}
r = isatty(fd);
}
r = isatty(fd);
- if (r < 0) {
- safe_close(fd);
- return -errno;
- }
-
- if (!r) {
+ if (r == 0) {
safe_close(fd);
return -ENOTTY;
}
safe_close(fd);
return -ENOTTY;
}
@@
-462,7
+457,7
@@
int acquire_terminal(
goto fail;
}
goto fail;
}
- r = fd_wait_for_event(
fd
, POLLIN, ts + timeout - n);
+ r = fd_wait_for_event(
notify
, POLLIN, ts + timeout - n);
if (r < 0)
goto fail;
if (r < 0)
goto fail;
@@
-1224,6
+1219,7
@@
bool colors_enabled(void) {
static int enabled = -1;
if (_unlikely_(enabled < 0)) {
static int enabled = -1;
if (_unlikely_(enabled < 0)) {
+#if 0 /// elogind does not allow such forcing, and we are never init!
int val;
val = getenv_bool("SYSTEMD_COLORS");
int val;
val = getenv_bool("SYSTEMD_COLORS");
@@
-1233,6
+1229,7
@@
bool colors_enabled(void) {
/* PID1 outputs to the console without holding it open all the time */
enabled = !getenv_terminal_is_dumb();
else
/* PID1 outputs to the console without holding it open all the time */
enabled = !getenv_terminal_is_dumb();
else
+#endif // 0
enabled = !terminal_is_dumb();
}
enabled = !terminal_is_dumb();
}