git: gpt(8): Fix gpt_read() to report partial read error
Aaron LI
aly at crater.dragonflybsd.org
Wed Feb 18 06:32:41 PST 2026
commit 52e637e75818de167141e68e56787617ad3c9608
Author: Aaron LI <aly at aaronly.me>
Date: Tue Sep 2 12:53:14 2025 +0800
gpt(8): Fix gpt_read() to report partial read error
A partial read() wouldn't touch 'errno', so the caller was unable to
know the error reason. This caused the program to print an error
message like:
```
gpt show: unable to open device 'vn4': Undefined error: 0
```
Fix gpt_read() to return E2BIG (I couldn't find a better choice) for a
partial read(), so the above error becomes:
```
gpt show: unable to open device 'vn4': Argument list too long
```
Still a bit weird, but better, I guess.
Summary of changes:
sbin/gpt/gpt.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/52e637e75818de167141e68e56787617ad3c9608
--
DragonFly BSD source repository
More information about the Commits
mailing list