git: DragonFly_RELEASE_6_4 gpt(8): Fix gpt_read() to report partial read error

Aaron LI aly at crater.dragonflybsd.org
Sat Feb 21 17:07:06 PST 2026


commit 176e90a8dc0834b0faa9b149684efc1317dc0949
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/176e90a8dc0834b0faa9b149684efc1317dc0949


-- 
DragonFly BSD source repository


More information about the Commits mailing list