Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package distcc for openSUSE:Factory checked 
in at 2021-05-13 22:18:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/distcc (Old)
 and      /work/SRC/openSUSE:Factory/.distcc.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "distcc"

Thu May 13 22:18:43 2021 rev:11 rq:892649 version:3.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/distcc/distcc.changes    2021-05-10 
15:41:45.800996302 +0200
+++ /work/SRC/openSUSE:Factory/.distcc.new.2988/distcc.changes  2021-05-13 
22:18:52.819517322 +0200
@@ -1,0 +2,8 @@
+Wed May 12 21:18:15 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 3.4:
+  * distccmon-gnome ported from gtk2 to gtk3
+  * Remove debug lag in spawning new threads. (better multi-core performance)
+  * Bug fixes.
+
+-------------------------------------------------------------------

Old:
----
  distcc-3.3.5.tar.gz

New:
----
  distcc-3.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ distcc.spec ++++++
--- /var/tmp/diff_new_pack.BLVYlY/_old  2021-05-13 22:18:53.307515625 +0200
+++ /var/tmp/diff_new_pack.BLVYlY/_new  2021-05-13 22:18:53.307515625 +0200
@@ -21,7 +21,7 @@
   %define _fillupdir %{_localstatedir}/adm/fillup-templates
 %endif
 Name:           distcc
-Version:        3.3.5
+Version:        3.4
 Release:        0
 Summary:        A distributed C/C++ compiler
 License:        GPL-2.0-or-later
@@ -42,7 +42,7 @@
 BuildRequires:  python
 BuildRequires:  update-desktop-files
 BuildRequires:  pkgconfig(avahi-client)
-BuildRequires:  pkgconfig(gtk+-2.0)
+BuildRequires:  pkgconfig(gtk+-3.0)
 BuildRequires:  pkgconfig(krb5)
 BuildRequires:  pkgconfig(libgssglue)
 BuildRequires:  pkgconfig(pango)

++++++ distcc-3.3.5.tar.gz -> distcc-3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/NEWS new/distcc-3.4/NEWS
--- old/distcc-3.3.5/NEWS       2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/NEWS 2021-05-11 19:26:29.000000000 +0200
@@ -1,3 +1,13 @@
+distcc-3.4 "Lax lexer" 2021-4-11
+
+  FEATURES
+
+   * distccmon-gnome ported from gtk2 to gtk3
+
+   * Remove debug lag in spawning new threads. (better multi-core performance)
+
+   * Bug fixes.
+
 distcc-3.3 "Charlie the unicorn" 2018-3-3
 
   FEATURES:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/configure.ac new/distcc-3.4/configure.ac
--- old/distcc-3.3.5/configure.ac       2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/configure.ac 2021-05-11 19:26:29.000000000 +0200
@@ -10,7 +10,7 @@
 
 # As of 0.6cvs, distcc no longer uses automake, only autoconf.
 AC_PREREQ(2.69)
-AC_INIT(distcc, 3.3.5, dis...@lists.samba.org)
+AC_INIT(distcc, 3.4, dis...@lists.samba.org)
 
 AC_CONFIG_HEADERS(src/config.h)
 AC_CONFIG_MACRO_DIRS([m4])
@@ -132,10 +132,10 @@
 # we need.  It's faster to just do it once during configuration.
 if test "x${with_gnome}" = xyes
 then
-    GNOME_PACKAGES="gtk+-2.0 libgnome-2.0 libgnomeui-2.0 pango"
+    GNOME_PACKAGES="gtk+-3.0 libgnome-3.0 libgnomeui-3.0 pango"
 elif test "x${with_gtk}" = xyes
 then
-    GNOME_PACKAGES="gtk+-2.0"
+    GNOME_PACKAGES="gtk+-3.0"
 else
     GNOME_PACKAGES=""
 fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/include_server/parse_command.py 
new/distcc-3.4/include_server/parse_command.py
--- old/distcc-3.3.5/include_server/parse_command.py    2021-01-04 
14:40:55.000000000 +0100
+++ new/distcc-3.4/include_server/parse_command.py      2021-05-11 
19:26:29.000000000 +0200
@@ -150,6 +150,7 @@
   '--param':        lambda ps, arg: None,
   '-Xassembler':    lambda ps, arg: None,
   '-Xlinker':       lambda ps, arg: None,
+  '-Xclang':        lambda ps, arg: None,
 }
 
 # For efficiency, it's helpful to be able to combine the two above
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/arg.c new/distcc-3.4/src/arg.c
--- old/distcc-3.3.5/src/arg.c  2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/arg.c    2021-05-11 19:26:29.000000000 +0200
@@ -189,6 +189,9 @@
                 rs_trace("-mtune=native optimizes for local machine; "
                          "must be local");
                 return EXIT_DISTCC_FAILED;
+            } else if (!strcmp(a, "-flto")) {
+                rs_trace("LTO cc invocations are not worth distributing");
+                return EXIT_DISTCC_FAILED;
             } else if (str_startswith("-Wa,", a)) {
                 /* Look for assembler options that would produce output
                  * files and must be local.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/daemon.c new/distcc-3.4/src/daemon.c
--- old/distcc-3.3.5/src/daemon.c       2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/daemon.c 2021-05-11 19:26:29.000000000 +0200
@@ -170,6 +170,12 @@
         rs_log_crit(LIBDIR "/distcc empty. %s", warn);
         dcc_exit(EXIT_COMPILER_MISSING);
     }
+    if (d) {
+        closedir(d);
+    }
+    if (e) {
+        closedir(e);
+    }
 }
 
 /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/mon-gnome.c 
new/distcc-3.4/src/mon-gnome.c
--- old/distcc-3.3.5/src/mon-gnome.c    2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/mon-gnome.c      2021-05-11 19:26:29.000000000 +0200
@@ -97,45 +97,39 @@
 };
 
 
-/**
- * Graphics contexts to be used to draw each particular state into the
- * model.
- **/
-GdkGC *dcc_phase_gc[DCC_PHASE_DONE];
-
-
-#if 0
-/* shades of red */
-const GdkColor task_color[] = {
-  { 0, 0x2222, 0, 0 },          /* DCC_PHASE_STARTUP, */
-  { 0, 0x4444, 0, 0 },          /* DCC_PHASE_BLOCKED, */
-  { 0, 0x6666, 0, 0 },          /* DCC_PHASE_CONNECT, */
-  { 0, 0x8888, 0, 0 },          /* DCC_PHASE_CPP, */
-  { 0, 0xaaaa, 0, 0 },          /* DCC_PHASE_SEND, */
-  { 0, 0xcccc, 0, 0 },          /* DCC_PHASE_COMPILE, */
-  { 0, 0xeeee, 0, 0 },          /* DCC_PHASE_RECEIVE, */
-  { 0, 0xffff, 0xffff, 0 },     /* DCC_PHASE_DONE */
-};
-#endif
-
 /*
- * Colors used for drawing different state stripes.  First GdkColor
- * field is the assigned color index and zero here.
+ * Colors used for drawing different state stripes.
  *
  * These color names are from the GNOME standard palette.
  */
-const GdkColor task_color[] = {
-  { 0, 0x9999, 0, 0 },          /* DCC_PHASE_STARTUP, accent red dark */
-  { 0, 0x9999, 0, 0 },          /* DCC_PHASE_BLOCKED, accent red dark */
-  { 0, 0xc1c1, 0x6666, 0x5a5a }, /* DCC_PHASE_CONNECT, red medium  */
-  { 0, 0x8888, 0x7f7f, 0xa3a3 }, /* DCC_PHASE_CPP, purple medium*/
-  { 0, 0xe0e0, 0xc3c3, 0x9e9e }, /* DCC_PHASE_SEND, face skin medium*/
-  { 0, 0x8383, 0xa6a6, 0x7f7f }, /* DCC_PHASE_COMPILE, green medium */
-  { 0, 0x7575, 0x9090, 0xaeae }, /* DCC_PHASE_RECEIVE, blue medium*/
-  { 0, 0, 0, 0 },               /* DCC_PHASE_DONE */
+GdkRGBA task_color[DCC_PHASE_DONE];
+
+const char * task_color_string[] = {
+  "#999900000000", /* DCC_PHASE_STARTUP, accent red dark */
+  "#999900000000", /* DCC_PHASE_BLOCKED, accent red dark */
+  "#c1c166665a5a", /* DCC_PHASE_CONNECT, red medium  */
+  "#88887f7fa3a3", /* DCC_PHASE_CPP, purple medium*/
+  "#e0e0c3c39e9e", /* DCC_PHASE_SEND, face skin medium*/
+  "#8383a6a67f7f", /* DCC_PHASE_COMPILE, green medium */
+  "#75759090aeae", /* DCC_PHASE_RECEIVE, blue medium*/
+  "#000000000000", /* DCC_PHASE_DONE */
 };
 
 
+/**
+ * Initialize rgba colors for drawing in the right color for each state.
+ **/
+static void
+dcc_create_state_colors (void)
+{
+  enum dcc_phase i_state;
+  for (i_state = 0; i_state <= DCC_PHASE_DONE; i_state++)
+    {
+      gdk_rgba_parse(&task_color[i_state],task_color_string[i_state]);
+    }
+}
+
+
 static void
 dcc_setup_tree_model (void)
 {
@@ -446,38 +440,19 @@
 
 
 /**
- * Initialize graphics context for drawing into a widget in the right
- * color for each state.
- **/
-static void
-dcc_create_state_gcs (GtkWidget *widget)
-{
-  enum dcc_phase i_state;
-
-  for (i_state = 0; i_state < DCC_PHASE_DONE; i_state++)
-    {
-      dcc_phase_gc[i_state] = gdk_gc_new (widget->window);
-      gdk_gc_set_rgb_fg_color (dcc_phase_gc[i_state],
-                               (GdkColor *) &task_color[i_state]);
-
-    }
-}
-
-
-/**
  * Configure GtkTreeView with the right columns bound to
  * renderers, and a data model.
  **/
 static void dcc_gnome_make_proc_view (GtkTreeModel *proc_model,
-                                      GtkWidget **align_return)
+                                      GtkWidget **widget_return)
 {
   GtkCellRenderer *text_renderer, *chart_renderer;
   GtkTreeSelection *selection;
   GtkTreeViewColumn *column;
-  GtkWidget *align, *proc_scroll;
+  GtkWidget *proc_scroll;
 
   chart_treeview = gtk_tree_view_new_with_model (proc_model);
-  gtk_object_set (GTK_OBJECT (chart_treeview),
+  g_object_set (G_OBJECT (chart_treeview),
                   "headers-visible", TRUE,
                   NULL);
 
@@ -485,10 +460,6 @@
 
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE);
 
-  /* we can't create the gcs until the widget is first realized */
-  g_signal_connect_after (chart_treeview, "realize",
-                          G_CALLBACK (dcc_create_state_gcs), NULL);
-
   text_renderer = gtk_cell_renderer_text_new ();
   chart_renderer = dcc_cell_renderer_chart_new ();
 
@@ -544,11 +515,7 @@
                                   GTK_POLICY_AUTOMATIC);
   gtk_container_add (GTK_CONTAINER (proc_scroll), chart_treeview);
 
-  /* Expands to fill all space */
-  align = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
-  gtk_container_add (GTK_CONTAINER (align), proc_scroll);
-
-  *align_return = align;
+  *widget_return = proc_scroll;
 }
 
 
@@ -558,6 +525,8 @@
   gint context_id;
 
   bar = gtk_statusbar_new ();
+  gtk_widget_set_margin_top(GTK_WIDGET(bar), 0);
+  gtk_widget_set_margin_bottom(GTK_WIDGET(bar), 0);
   context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR (bar), "load");
 
   gtk_statusbar_push(GTK_STATUSBAR (bar), context_id, "Load: ");
@@ -592,9 +561,9 @@
   gtk_window_set_default_size (GTK_WINDOW (mainwin), 500, 300);
 
   /* Quit when it's closed */
-  g_signal_connect (GTK_OBJECT(mainwin), "delete-event",
+  g_signal_connect (G_OBJECT(mainwin), "delete-event",
                     G_CALLBACK (gtk_main_quit), NULL);
-  g_signal_connect (GTK_OBJECT(mainwin), "destroy",
+  g_signal_connect (G_OBJECT(mainwin), "destroy",
                     G_CALLBACK (gtk_main_quit), NULL);
 
 #if GTK_CHECK_VERSION(2,2,0)
@@ -615,8 +584,9 @@
   /* Create the main window */
   mainwin = dcc_gnome_make_mainwin ();
 
-  /* Create a vbox for the contents */
-  topbox = gtk_vbox_new (FALSE, 0);
+  /* Create a gtkbox for the contents */
+  topbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+
   gtk_container_add (GTK_CONTAINER (mainwin),
                      topbox);
 
@@ -628,6 +598,13 @@
   gtk_container_add (GTK_CONTAINER (topbox),
                      proc_align);
 
+  gtk_box_set_child_packing (GTK_BOX (topbox),
+                             GTK_WIDGET (proc_align),
+                             TRUE,
+                             TRUE,
+                             0,
+                             GTK_PACK_START);
+
   gtk_box_pack_end (GTK_BOX (topbox),
                     load_bar,
                     FALSE, /* expand */
@@ -653,17 +630,10 @@
    * compilation */
   nice(5);
 
-#if defined(WITH_GNOME)
-  gnome_program_init ("distccmon-gnome", PACKAGE_VERSION,
-              LIBGNOMEUI_MODULE,
-              argc, argv, NULL);
-#elif defined(WITH_GTK)
   gtk_init (&argc, &argv);
-#else
-#  error This program must be built with either WITH_GTK or WITH_GNOME
-#endif
 
   /* do our own initialization */
+  dcc_create_state_colors();
   dcc_gnome_make_app ();
 
   /* Keep running until quit */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/prefork.c 
new/distcc-3.4/src/prefork.c
--- old/distcc-3.3.5/src/prefork.c      2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/prefork.c        2021-05-11 19:26:29.000000000 +0200
@@ -37,6 +37,7 @@
 #include <syslog.h>
 #include <signal.h>
 #include <fcntl.h>
+#include <time.h>
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -91,10 +92,6 @@
 
             /* wait for any children to exit, and then start some more */
             dcc_reap_kids(TRUE);
-
-            /* Another little safety brake here: since children should not exit
-             * too quickly, pausing before starting them should be harmless. */
-            sleep(1);
         }
     }
 }
@@ -133,10 +130,6 @@
             ++dcc_nkids;
             rs_trace("up to %d children", dcc_nkids);
         }
-
-        /* Don't start them too quickly, or we might overwhelm a machine
-         * that's having trouble. */
-        sleep(1);
     }
 }
 
@@ -151,9 +144,12 @@
 static int dcc_preforked_child(int listen_fd)
 {
     int ireq;
-    const int child_lifetime = 50;
+    time_t start, now;
+    const int child_requests = 50;
+    const time_t child_lifetime = 60 /* seconds */;
+    start = now = time(NULL);
 
-    for (ireq = 0; ireq < child_lifetime; ireq++) {
+    for (ireq = 0; ireq < child_requests || now - start < child_lifetime; 
ireq++) {
         int acc_fd;
         struct dcc_sockaddr_storage cli_addr;
         socklen_t cli_len;
@@ -188,6 +184,7 @@
                            (struct sockaddr *) &cli_addr, cli_len);
 
         dcc_close(acc_fd);
+        now = time(NULL);
     }
 
     rs_log_info("worn out");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/renderer.c 
new/distcc-3.4/src/renderer.c
--- old/distcc-3.3.5/src/renderer.c     2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/renderer.c       2021-05-11 19:26:29.000000000 +0200
@@ -160,18 +160,17 @@
  **/
 static void
 dcc_cell_renderer_chart_render (GtkCellRenderer      *cell,
-                                GdkWindow            *window,
+                                cairo_t              *cr,
                                 GtkWidget            *UNUSED(widget),
-                                GdkRectangle         *UNUSED(background_area),
-                                GdkRectangle         *cell_area,
-                                GdkRectangle         *UNUSED(expose_area),
+                                const GdkRectangle   *UNUSED(background_area),
+                                const GdkRectangle   *cell_area,
                                 GtkCellRendererState  UNUSED(flags))
 {
   const struct dcc_history *history;
   enum dcc_phase state;
   int x1, y1;
-  int bar_height;
-  int bar_width;
+  int bar_height, bar_width;
+  int xpad, ypad;
   int i;
   const enum dcc_phase *phases;
 
@@ -179,10 +178,10 @@
 
   history = cellchart->history;
   g_return_if_fail (history);  /* Perhaps we should just ignore this.. */
-
-  x1 = cell_area->x + cell->xpad;
-  y1 = cell_area->y + cell->ypad;
-  bar_height = cell_area->height - (2 * cell->ypad);
+  gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
+  x1 = cell_area->x + xpad;
+  y1 = cell_area->y + ypad;
+  bar_height = cell_area->height - (2 * ypad);
 
   /* bar width is chosen such that the history roughly fills the cell
      (but it must be at least 1).  We use the full history, not just
@@ -200,10 +199,9 @@
 
       if (state != DCC_PHASE_DONE)
         {
-          gdk_draw_rectangle (window,
-                              dcc_phase_gc[state],
-                              TRUE, /* fill */
-                              x1, y1, bar_width, bar_height);
+          gdk_cairo_set_source_rgba (cr, &task_color[state]);
+          cairo_rectangle (cr, x1, y1, bar_width, bar_height);
+          cairo_fill (cr);
         }
 
       x1 += bar_width;
@@ -212,26 +210,10 @@
 
 
 
-/**
- * Measure the size that we want to have allocated for this cell.
- */
-static void
-dcc_cell_renderer_chart_get_size (GtkCellRenderer *UNUSED(cell),
-                                  GtkWidget       *UNUSED (widget),
-                                  GdkRectangle    *UNUSED (cell_area),
-                                  gint            *UNUSED (x_offset),
-                                  gint            *UNUSED (y_offset),
-                                  gint            *UNUSED (width),
-                                  gint            *UNUSED (height))
-{
-  /* default is fine */
-}
-
-
-
 
 static void
-dcc_cell_renderer_chart_class_init (DccCellRendererChartClass *class)
+dcc_cell_renderer_chart_class_init (DccCellRendererChartClass *class,
+                                    gpointer UNUSED(klass))
 {
   GParamSpec *spec;
 
@@ -242,7 +224,6 @@
   object_class->set_property = dcc_cell_renderer_chart_set_property;
 
   cell_class->render = dcc_cell_renderer_chart_render;
-  cell_class->get_size = dcc_cell_renderer_chart_get_size;
 
   spec = g_param_spec_pointer ("history",
                                "Slot history",
@@ -257,7 +238,8 @@
 
 /* Instance initialization */
 static void
-dcc_cell_renderer_chart_init (DccCellRendererChart *cell)
+dcc_cell_renderer_chart_init (DccCellRendererChart *cell,
+                              gpointer UNUSED(klass))
 {
   cell->history = NULL;
 }
@@ -277,20 +259,20 @@
     {
       static const GTypeInfo cell_chart_info =
       {
-    sizeof (DccCellRendererChartClass),
-    NULL,        /* base_init */
-    NULL,        /* base_finalize */
-    (GClassInitFunc) dcc_cell_renderer_chart_class_init,
-    NULL,        /* class_finalize */
-    NULL,        /* class_data */
-    sizeof (DccCellRendererChart),
-    0,              /* n_preallocs */
-    (GInstanceInitFunc) dcc_cell_renderer_chart_init,
-        NULL                    /* value_table */
+        sizeof (DccCellRendererChartClass),
+        NULL,        /* base_init */
+        NULL,        /* base_finalize */
+        (GClassInitFunc) dcc_cell_renderer_chart_class_init,
+        NULL,        /* class_finalize */
+        NULL,        /* class_data */
+        sizeof (DccCellRendererChart),
+        0,           /* n_preallocs */
+        (GInstanceInitFunc) dcc_cell_renderer_chart_init,
+        NULL         /* value_table */
       };
 
       cell_chart_type =
-    g_type_register_static (GTK_TYPE_CELL_RENDERER,
+        g_type_register_static (GTK_TYPE_CELL_RENDERER,
                                 "DccCellRendererChart",
                                 &cell_chart_info, 0);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/renderer.h 
new/distcc-3.4/src/renderer.h
--- old/distcc-3.3.5/src/renderer.h     2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/renderer.h       2021-05-11 19:26:29.000000000 +0200
@@ -42,7 +42,5 @@
 GType            dcc_cell_renderer_chart_get_type (void);
 GtkCellRenderer *dcc_cell_renderer_chart_new      (void);
 
-
-extern GdkGC *dcc_phase_gc[DCC_PHASE_DONE];
-
 extern const guint dcc_max_history_queue;
+extern GdkRGBA task_color[];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distcc-3.3.5/src/serve.c new/distcc-3.4/src/serve.c
--- old/distcc-3.3.5/src/serve.c        2021-01-04 14:40:55.000000000 +0100
+++ new/distcc-3.4/src/serve.c  2021-05-11 19:26:29.000000000 +0200
@@ -403,8 +403,10 @@
 
     if (faccessat(dirfd, compiler_name, X_OK, 0) < 0) {
         char *compiler_path = NULL;
-        if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) && 
compiler_path) {
+        if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) >= 
0) {
             if (access(compiler_path, X_OK) < 0) {
+                free(compiler_path);
+                close(dirfd);
                 rs_log_crit("%s not in %s or %s whitelist.", compiler_name, 
LIBDIR "/distcc", "/usr/lib/distcc");
                 return EXIT_BAD_ARGUMENTS;           /* ENOENT, EACCESS, etc */
             }
@@ -412,31 +414,33 @@
         }
     }
 
+    close(dirfd);
+
     rs_trace("%s in" LIBDIR "/distcc whitelist", compiler_name);
     return 0;
 #else
     // make do with access():
-    char *compiler_path = NULL;
+    char *compiler_path;
     int ret = 0;
-    if (asprintf(&compiler_path, "%s/distcc/%s", LIBDIR, compiler_name) && 
compiler_path) {
+    if (asprintf(&compiler_path, "%s/distcc/%s", LIBDIR, compiler_name) >= 0) {
         if (access(compiler_path, X_OK) < 0) {
             free(compiler_path);
             /* check /usr/lib/distcc too */
-            if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) 
&& compiler_path) {
+            if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) 
>= 0) {
                 if (access(compiler_path, X_OK) < 0) {
                     rs_log_crit("%s not in %s or %s whitelist.", 
compiler_name, LIBDIR "/distcc", "/usr/lib/distcc");
                     ret = EXIT_BAD_ARGUMENTS;           /* ENOENT, EACCESS, 
etc */
                 }
+                free(compiler_path);
             }
-        }
+        } else {
+            free(compiler_path);
+       }
         rs_trace("%s in" LIBDIR "/distcc whitelist", compiler_name);
     } else {
         rs_log_crit("Couldn't check if %s is in %s whitelist.", compiler_name, 
LIBDIR "/distcc");
         ret = EXIT_DISTCC_FAILED;
     }
-    if (compiler_path) {
-        free(compiler_path);
-    }
     return ret;
 #endif
 }

Reply via email to