On 02/14/2018 01:58 PM, Lukáš Hrázký wrote:
It was mainly a debugging feature for the early development stages. It
was agreed it's usefulness is at the moment outweighted by the


its usefulness ...

spellchecker also suggests: outweighed

Looks good, see nit comment below (not important, smaller diff).

complexity it brings to the code.

Signed-off-by: Lukáš Hrázký <lhra...@redhat.com>
---
Changes since v1:
- Log also to stderr if it's a tty

  src/spice-streaming-agent.cpp | 72 ++++++++++---------------------------------
  1 file changed, 16 insertions(+), 56 deletions(-)

diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
index f4fee2d..173cd24 100644
--- a/src/spice-streaming-agent.cpp
+++ b/src/spice-streaming-agent.cpp
@@ -152,24 +121,19 @@ static int read_command_from_device(void)

<deleted>
@@ -446,22 +409,19 @@ int main(int argc, char* argv[])
          { 0, 0, 0, 0}
      };
- if (isatty(fileno(stderr)) && isatty(fileno(stdin))) {
-        stdin_ok = true;
+    if (isatty(fileno(stderr))) {
+        openlog("spice-streaming-agent", LOG_PID | LOG_PERROR, LOG_USER);
+    } else {
+        openlog("spice-streaming-agent", LOG_PID, LOG_USER);
      }
- openlog("spice-streaming-agent", stdin_ok? (LOG_PERROR|LOG_PID) : LOG_PID, LOG_USER);
      setlogmask(logmask);

nitpick: OK, but you could have simply replaced
   stdin_ok? with isatty(fileno(stderr)?


Uri.
_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to