Просмотр исходного кода

libdpkg: Use fp instead of stdout on isatty() in dpkg_set_report_buffer()

Do not hardcode the file descriptor when calling isatty(), use the
one provided as an argument.

Regression introduced in commit 50c1cb4d6e8b4c3ee739646f9df05992b806ea5e.
Guillem Jover лет назад: 12
Родитель
Сommit
d7b89a456a
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      lib/dpkg/report.c

+ 1 - 1
lib/dpkg/report.c

@@ -34,7 +34,7 @@
 void
 dpkg_set_report_buffer(FILE *fp)
 {
-	if (isatty(STDOUT_FILENO))
+	if (isatty(fileno(fp)))
 		setvbuf(fp, NULL, _IONBF, 0);
 	else
 		setvbuf(fp, NULL, _IOFBF, 0);