| 904 | } |
| 905 | |
| 906 | void copy_and_clean_results(result_t *results, int result_count, char copy) |
| 907 | { |
| 908 | static result_t old_results[MAX_RESULTS]; |
| 909 | static int old_result_count = 0; |
| 910 | |
| 911 | if (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 | } |
| 929 | else { |
| 930 | memcpy(old_results, results, sizeof(old_results)); |
| 931 | old_result_count = result_count; |
| 932 | } |
| 933 | } |
| 934 | |
| 935 | int monitor_processes(int *nb_pid) |
| 936 | { |
no test coverage detected