morgant / xwf

X Window Filemanager
GNU General Public License v2.0
7 stars 0 forks source link

Replace `nice` with `setpriority` #9

Closed morgant closed 3 years ago

morgant commented 3 years ago

We get Warning: nice() failed! warnings when duplicating files with xcp. io_system_nice() in lib-src/io.c uses nice(3), but getpriority(2) is the POSIX way of doing things, so we should switch to that.

morgant commented 3 years ago

Upon further testing, we're not getting any errors when using using xwf's "Open With..." option, which is what calls io_system_nice() (with or without a nice value specified). That said, we should still update it to use setpriority() instead of nice().

That said, xcp is calling nice() in main() and that's where the warning is coming from. That obviously needs to be fixed, as well.

morgant commented 3 years ago

I have updated xcp to use setpriority() instead of nice().

morgant commented 3 years ago

I have also updated io_system_nice() to use setpriority() instead of nice().