Przeglądaj źródła

libdpkg: Set the appropriate report buffer for the debug output

Do so centrally in the debug_set_output() function instead of on the
call sites.
Guillem Jover 12 lat temu
rodzic
commit
76650b3c3e
2 zmienionych plików z 2 dodań i 1 usunięć
  1. 0 1
      dselect/main.cc
  2. 2 0
      lib/dpkg/debug.c

+ 0 - 1
dselect/main.cc

@@ -230,7 +230,6 @@ extern "C" {
     fp = fopen(v, "a");
     if (!fp)
       ohshite(_("couldn't open debug file `%.255s'\n"), v);
-    dpkg_set_report_buffer(fp);
 
     debug_set_output(fp);
     debug_set_mask(dbg_general | dbg_depcon);

+ 2 - 0
lib/dpkg/debug.c

@@ -25,6 +25,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 
+#include <dpkg/report.h>
 #include <dpkg/debug.h>
 
 static int debug_mask = 0;
@@ -36,6 +37,7 @@ static FILE *debug_output = NULL;
 void
 debug_set_output(FILE *output)
 {
+	dpkg_set_report_buffer(output);
 	debug_output = output;
 }