MCPcopy Create free account
hub / github.com/Xfennec/progress / copy_and_clean_results

Function copy_and_clean_results

progress.c:906–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904}
905
906void copy_and_clean_results(result_t *results, int result_count, char copy)
907{
908static result_t old_results[MAX_RESULTS];
909static int old_result_count = 0;
910
911if (copy) {
912 int i;
913 for (i = 0; i < old_result_count; ++i) {
914 int j;
915 char found = 0;
916 for (j = 0; j < result_count; ++j) {
917 if (results[j].pid.pid == old_results[i].pid.pid) {
918 found = 1;
919 results[j].hbegin = old_results[i].hbegin;
920 results[j].hend = old_results[i].hend;
921 results[j].hsize = old_results[i].hsize;
922 break;
923 }
924 }
925 if (!found)
926 free_hlist(old_results[i].hbegin);
927 }
928}
929else {
930 memcpy(old_results, results, sizeof(old_results));
931 old_result_count = result_count;
932 }
933}
934
935int monitor_processes(int *nb_pid)
936{

Callers 1

monitor_processesFunction · 0.85

Calls 1

free_hlistFunction · 0.85

Tested by

no test coverage detected