diff options
author | sobomax <sobomax@FreeBSD.org> | 2005-11-30 19:24:51 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2005-11-30 19:24:51 +0000 |
commit | 29543921eae6a40180f2f784021ed1b42d328e2a (patch) | |
tree | 81ef73354089000f24e964c7cdffc0035dfe7d01 /sys/geom/mirror | |
parent | 937b629bd5f0ccf20166962cb9ec63905573b02c (diff) | |
download | FreeBSD-src-29543921eae6a40180f2f784021ed1b42d328e2a.zip FreeBSD-src-29543921eae6a40180f2f784021ed1b42d328e2a.tar.gz |
Check for g_read_data(9) errors properly:
o The only indication of error condition is NULL value returned by
the function;
o value pointed to by error argument is undefined in the case when
operation completes successfully.
Discussed with: phk
Diffstat (limited to 'sys/geom/mirror')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index b6b0040..e627c60 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -2346,7 +2346,7 @@ g_mirror_read_metadata(struct g_consumer *cp, struct g_mirror_metadata *md) &error); g_topology_lock(); g_access(cp, -1, 0, 0); - if (error != 0) { + if (buf == NULL) { G_MIRROR_DEBUG(1, "Cannot read metadata from %s (error=%d).", cp->provider->name, error); if (buf != NULL) |