Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf/selftests: Small vmtest.sh fixes #3464

Closed
wants to merge 3 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: bpf/selftests: Small vmtest.sh fixes
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=666344

@kernel-patches-bot
Copy link
Author

Master branch: 11b9148
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=666344
version: 1

@kernel-patches-bot
Copy link
Author

Master branch: a00ed84
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=666344
version: 1

Set the exit trap only after argument parsing is done. This way argument
parse failure or `-h` will not require sudo.

Reasoning is that it's confusing that a help message would require root
access.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Before, you could see the following errors:

```
$ ./vmtest.sh -j
./vmtest.sh: option requires an argument -- j
./vmtest.sh: line 357: OPTARG: unbound variable

$ ./vmtest.sh -z
./vmtest.sh: illegal option -- z
./vmtest.sh: line 357: OPTARG: unbound variable
```

Fix by adding ':' as first character of optstring. Reason is that
getopts requires ':' as the first character for OPTARG to be set in the
`?` and `:` error cases.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=666344 irrelevant now. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/666344=>bpf-next branch August 9, 2022 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants