mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-10-31 22:11:20 +00:00 
			
		
		
		
	shutils/cgroups: Don't fail when racing with process exit
If a process is added to $PIDS but then exits before the cgroups_task_move invokation finishes, then echoing its PID to cgroups.procs results in an I/O error. If that process is the last in $PIDS, then that failing echo command is the last of the function, so the script exits with an error and devlib raises an exception. Add `|| true` to avoid this problem.
This commit is contained in:
		| @@ -163,7 +163,7 @@ cgroups_tasks_move() { | |||||||
| 	for TID in $PIDS; do | 	for TID in $PIDS; do | ||||||
| 	  COMM=`$CAT /proc/$TID/comm` | 	  COMM=`$CAT /proc/$TID/comm` | ||||||
| 	  echo "$TID : $COMM" | 	  echo "$TID : $COMM" | ||||||
| 	  echo $TID > $SRC_GRP/cgroup.procs | 	  echo $TID > $SRC_GRP/cgroup.procs || true | ||||||
| 	done | 	done | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user