Commit 922a1b5
selftests/seccomp: Refactor get_proc_stat to split out file reading code
This splits up the get_proc_stat function to make it so we can use it as a
generic helper to read the nth field from multiple different files, versus
replicating the logic in multiple places.
Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220503080958.20220-3-sargun@sargun.me1 parent c2aa2df commit 922a1b5
1 file changed
Lines changed: 38 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4297 | 4297 | | |
4298 | 4298 | | |
4299 | 4299 | | |
4300 | | - | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
4301 | 4308 | | |
4302 | | - | |
4303 | 4309 | | |
4304 | | - | |
| 4310 | + | |
4305 | 4311 | | |
4306 | | - | |
| 4312 | + | |
4307 | 4313 | | |
4308 | | - | |
4309 | 4314 | | |
4310 | | - | |
4311 | | - | |
4312 | | - | |
4313 | | - | |
4314 | | - | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
4315 | 4319 | | |
4316 | | - | |
| 4320 | + | |
4317 | 4321 | | |
4318 | | - | |
4319 | | - | |
4320 | | - | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
4321 | 4325 | | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
| 4344 | + | |
4322 | 4345 | | |
4323 | 4346 | | |
4324 | 4347 | | |
4325 | | - | |
4326 | 4348 | | |
4327 | 4349 | | |
4328 | 4350 | | |
| |||
4383 | 4405 | | |
4384 | 4406 | | |
4385 | 4407 | | |
4386 | | - | |
| 4408 | + | |
4387 | 4409 | | |
4388 | 4410 | | |
4389 | 4411 | | |
| |||
0 commit comments