mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Builds on Linux again!
This commit is contained in:
@ -5,20 +5,26 @@ Released under the GNU GPL, see the COPYING file
|
||||
in the source distribution for its full text.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
#include "IOPriority.h"
|
||||
#include "IOPriorityPanel.h"
|
||||
#include "LinuxProcess.h"
|
||||
|
||||
/*{
|
||||
#include "Action.h"
|
||||
}*/
|
||||
|
||||
static Htop_Reaction Platform_actionSetIOPriority(Panel* panel, ProcessList* pl, Header* header) {
|
||||
(void) panel, (void) pl;
|
||||
Process* p = (Process*) Panel_getSelected(panel);
|
||||
LinuxProcess* p = (LinuxProcess*) Panel_getSelected(panel);
|
||||
if (!p) return HTOP_OK;
|
||||
IOPriority ioprio = p->ioPriority;
|
||||
Panel* ioprioPanel = IOPriorityPanel_new(ioprio);
|
||||
const char* fuFunctions[] = {"Set ", "Cancel ", NULL};
|
||||
void* set = pickFromVector(panel, ioprioPanel, 21, fuFunctions, header);
|
||||
void* set = Action_pickFromVector(panel, ioprioPanel, 21, fuFunctions, header);
|
||||
if (set) {
|
||||
IOPriority ioprio = IOPriorityPanel_getIOPriority(ioprioPanel);
|
||||
bool ok = Action_foreachProcess(panel, (Action_ForeachProcessFn) Process_setIOPriority, (size_t) ioprio, NULL);
|
||||
bool ok = Action_foreachProcess(panel, (Action_ForeachProcessFn) LinuxProcess_setIOPriority, (size_t) ioprio, NULL);
|
||||
if (!ok)
|
||||
beep();
|
||||
}
|
||||
|
Reference in New Issue
Block a user