Bug #8567

Inconsistent return value in zpool_read_label

Added by Alan Somers 15 days ago.

Status:NewStart date:2017-08-07
Priority:LowDue date:
Assignee:Alan Somers% Done:

0%

Category:-
Target version:-
Difficulty:Bite-size Tags:needs-triage

Description

If fstat64 fails, pread64 fails, or the label is unintelligible, zpool_read_label will return 0. But if malloc fails, it will return -1. For consistency, it should always return -1 on failure or 0 on success.

Also available in: Atom