diff --git a/fix-chinese-output-garbled.patch b/fix-chinese-output-garbled.patch new file mode 100644 index 0000000000000000000000000000000000000000..644c0dda40a1dea91362e2c7c14bde21d1fc6837 --- /dev/null +++ b/fix-chinese-output-garbled.patch @@ -0,0 +1,37 @@ +diff --git a/configure.ac b/configure.ac +index 0acb1b7..4d95893 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -13,9 +13,9 @@ AM_INIT_AUTOMAKE([subdir-objects]) + CC="$CC -std=gnu11" + + # Checks for libraries. +-AC_CHECK_LIB(ncurses, initscr, [], [echo "missing ncurses support!";exit -1]) +-NCURSES_LIBS="-lncurses" +-AC_SUBST([NCURSES_LIBS]) ++AC_CHECK_LIB(ncursesw, initscr, [], [echo "missing ncurses support!";exit -1]) ++NCURSESW_LIBS="-lncursesw" ++AC_SUBST([NCURSESW_LIBS]) + + # Checks for header files. + AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h]) +diff --git a/src/vmtop.c b/src/vmtop.c +index caa598e..78b6f4e 100644 +--- a/src/vmtop.c ++++ b/src/vmtop.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include "vmtop.h" + #include "field.h" +@@ -52,6 +53,7 @@ static void init_screen(void) + + static void init_parameter(void) + { ++ setlocale(LC_ALL, ""); + init_domains(&scr_cur); + init_domains(&scr_pre); + init_domains(&vcpu_list); diff --git a/vmtop.spec b/vmtop.spec index 2b1514f1b3e29da1a0135b192cd25237605e8e00..c3103711cd7a1a5b7b4257828a1d47009fd1c1a3 100644 --- a/vmtop.spec +++ b/vmtop.spec @@ -1,6 +1,6 @@ Name: vmtop Version: 1.1 -Release: 8 +Release: 9 Summary: A tool for collecting and analyzing data of virtual machine License: MulanPSL-2.0 Group: Application/System @@ -40,6 +40,7 @@ Patch0029: proc-del-loop-sscanf-for-proc-pid-stat-file.patch Patch0030: utils-del-realpath-from-read_file.patch Patch0031: add-README.zh.md.-update-README.md.patch Patch0032: domain-change-method-of-getting-domain-id.patch +Patch0033: fix-chinese-output-garbled.patch Requires: libvirt, ncurses @@ -80,6 +81,9 @@ install -m 550 vmtop ${RPM_BUILD_ROOT}/usr/bin/%{name} %{_bindir}/vmtop %changelog +* Thu Mar 20 2025 liweigang - 1.1-9 +- fix chinese output garbled + * Sat Jul 27 2024 liangtian - 1.1-8 - domain: change method of getting domain id