Skip to content

Commit

Permalink
Fix updating PID list of monitored application
Browse files Browse the repository at this point in the history
  • Loading branch information
adelnoureddine committed Jul 11, 2024
1 parent 5fe6092 commit 7ed27bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cpu_stat_app.adb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ package body CPU_STAT_App is
Command : String := "pidof " & To_String (App_Data.App_Name);
Args : Argument_List_Access;
Status : aliased Integer;
Subs : String_Split.Slice_Set; -- Used to slice the read data from stat file
Subs : String_Split.Slice_Set; -- Used to slice the read data from PID list
Seps : constant String := " "; -- Seperator (space) for slicing string
Slice_number_count : String_Split.Slice_Number;
Loop_I : Integer;
Test : Integer;
begin
Args := Argument_String_To_List (Command);
declare
Expand All @@ -94,7 +95,7 @@ package body CPU_STAT_App is

for I in 1 .. Slice_number_count loop
Loop_I := Integer'Value (String_Split.Slice_Number'Image (I));
App_Data.PID_Array(Loop_I) := Integer'Value (String_Split.Slice (Subs, 1));
App_Data.PID_Array(Loop_I) := Integer'Value (String_Split.Slice (Subs, I));
end loop;
end;
exception
Expand Down

0 comments on commit 7ed27bf

Please sign in to comment.