Re: [PATCH spice-streaming-agent v2] Remove reading start/stop commands from stdin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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ý <lhrazky@xxxxxxxxxx>
---
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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]