Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue "Codepage broken in Russian version of radeontop" #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wb027
Copy link

@wb027 wb027 commented Aug 2, 2018

@clbr
Copy link
Owner

clbr commented Aug 2, 2018

The setlocale call is made in radeontop.c, and the Makefile change would break the build on some systems, so I can't accept this change. What's your distro if the pkg-config call fails?

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

Can you pass this correction to the maintainer ubuntu? I do not know how to do it correctly.

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

"What's your distro if the pkg-config call fails?"
Sorry, I did not understand this question.
I'm not a programmer, I'm a simple user.

@clbr
Copy link
Owner

clbr commented Aug 2, 2018

What happens if you run this:

pkg-config --libs ncursesw 2>/dev/null || pkg-config --libs ncurses 2>/dev/null ||echo "fell"

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

-lncursesw -ltinfo

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

I'm sorry, I forgot to say: libncursesw5-dev is required to success compile.

@clbr
Copy link
Owner

clbr commented Aug 2, 2018

Your output means your Makefile change was not needed. Now that you installed the correct dev package, does radeontop work without any changes?

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

Yes, it works!
Now only in ui.c change needed:
+ setlocale(LC_ALL, "");

@clbr
Copy link
Owner

clbr commented Aug 2, 2018

That already happens in radeontop.c. Please try to find out why, calling it twice should not be necessary.

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

I do not know how to do that. But make no complains about twice setlocale().
Here is the full output of make:
onotole@home:~/projects/radeontop$ make cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o detect.o detect.c cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o ticks.o ticks.c cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o radeontop.o radeontop.c radeontop.c: In function ‘main’: radeontop.c:79:2: warning: ignoring return value of ‘seteuid’, declared with attribute warn_unused_result [-Wunused-result] seteuid(getuid()); ^~~~~~~~~~~~~~~~~ radeontop.c:151:2: warning: ignoring return value of ‘seteuid’, declared with attribute warn_unused_result [-Wunused-result] seteuid(0); ^~~~~~~~~~ radeontop.c:155:2: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result] setuid(getuid()); ^~~~~~~~~~~~~~~~ cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o ui.o ui.c ui.c: In function ‘printcenter’: ui.c:30:2: warning: ignoring return value of ‘vasprintf’, declared with attribute warn_unused_result [-Wunused-result] vasprintf(&ptr, fmt, ap); ^~~~~~~~~~~~~~~~~~~~~~~~ ui.c: In function ‘printright’: ui.c:53:2: warning: ignoring return value of ‘vasprintf’, declared with attribute warn_unused_result [-Wunused-result] vasprintf(&ptr, fmt, ap); ^~~~~~~~~~~~~~~~~~~~~~~~ cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o auth.o auth.c cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o dump.o dump.c cc -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -c -o family_str.o family_str.c cc -o radeontop detect.o ticks.o radeontop.o ui.o auth.o dump.o family_str.o -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -Wl,-O1 -Wl,-gc-sections -lpciaccess -ldrm -ldl -lncursesw -ltinfo cc -shared -fPIC -o libradeontop_xcb.so auth_xcb.c -Os -Wall -Wextra -pthread -Iinclude -ffunction-sections -fdata-sections -I/usr/include/libdrm -DENABLE_XCB=1 -D_GNU_SOURCE -D_DEFAULT_SOURCE -DENABLE_NLS=1 -s -Wl,-O1 -Wl,-gc-sections -lxcb -lxcb-dri2
sorry, the new lines were missing when pasted :(

@wb027
Copy link
Author

wb027 commented Aug 2, 2018

I tried to remove setlocale(LC_ALL, "") from radeontop.c and add to ui.c.
It turned out all the same bullshit, but a different kind.
I have a working version compiled only if in both files add setlocale (LC_ALL, "").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants