[Spice-devel] [PATCH spice-streaming-agent 6/9] Remove the logmask variable

Frediano Ziglio fziglio at redhat.com
Thu Jun 14 09:11:48 UTC 2018


> 
> The variable is unnecessary, we can pass the value straight to
> setlogmask().
> 
> Signed-off-by: Lukáš Hrázký <lhrazky at redhat.com>

Acked-by: Frediano Ziglio <fziglio at redhat.com>

> ---
>  src/spice-streaming-agent.cpp | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
> index 392936a..2bdfc32 100644
> --- a/src/spice-streaming-agent.cpp
> +++ b/src/spice-streaming-agent.cpp
> @@ -409,7 +409,6 @@ int main(int argc, char* argv[])
>      const char *log_filename = NULL;
>      bool log_binary = false;
>      bool log_frames = false;
> -    int logmask = LOG_UPTO(LOG_WARNING);
>      const char *pluginsdir = PLUGINSDIR;
>      enum {
>          OPT_first = UCHAR_MAX,
> @@ -428,7 +427,7 @@ int main(int argc, char* argv[])
>  
>      SyslogRAII syslog_raii;
>  
> -    setlogmask(logmask);
> +    setlogmask(LOG_UPTO(LOG_WARNING));
>  
>      while ((opt = getopt_long(argc, argv, "hp:c:l:d", long_options, NULL))
>      != -1) {
>          switch (opt) {
> @@ -467,8 +466,7 @@ int main(int argc, char* argv[])
>              log_filename = optarg;
>              break;
>          case 'd':
> -            logmask = LOG_UPTO(LOG_DEBUG);
> -            setlogmask(logmask);
> +            setlogmask(LOG_UPTO(LOG_DEBUG));
>              break;
>          case 'h':
>              usage(argv[0]);

Frediano


More information about the Spice-devel mailing list