diff options
author | phk <phk@FreeBSD.org> | 2003-03-27 14:32:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-03-27 14:32:52 +0000 |
commit | 5447a01760d39222ce6958c12e893d7f8188883c (patch) | |
tree | 22916f09605b9b9e9dfb61b085b8b410d940524b /sys | |
parent | 23ec3f074f64bd25ef012cfc13595b16fcb69138 (diff) | |
download | FreeBSD-src-5447a01760d39222ce6958c12e893d7f8188883c.zip FreeBSD-src-5447a01760d39222ce6958c12e893d7f8188883c.tar.gz |
Check return value of g_call_me()
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/geom_disk.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index e79fe64..494e094 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -376,11 +376,12 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); sbuf_clear(sb); - g_call_me(g_kern_disks, sb); - do { + error = g_call_me(g_kern_disks, sb); + while (!error && !sbuf_done(sb)) { tsleep(sb, PZERO, "kern.disks", hz); - } while(!sbuf_done(sb)); - error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); + } + if (!error) + error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); return error; } |