From 8f61276d403fde3c3d8f1a5cbd53130df5842c1e Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Wed, 6 Apr 2016 00:01:03 +0000 Subject: [PATCH] bhyveload: fix from loading undefined size. We were setting an incorrect/undefined size and as it came out the st struct was not really being used at all. This was actually a bug but by sheer luck it had no visual effect. CID: 1194320 Reviewed by: grehan --- usr.sbin/bhyveload/bhyveload.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/bhyveload/bhyveload.c b/usr.sbin/bhyveload/bhyveload.c index 8417f2a7efa3..9df680f57121 100644 --- a/usr.sbin/bhyveload/bhyveload.c +++ b/usr.sbin/bhyveload/bhyveload.c @@ -152,7 +152,6 @@ struct cb_file { static int cb_open(void *arg, const char *filename, void **hp) { - struct stat st; struct cb_file *cf; char path[PATH_MAX]; @@ -169,7 +168,7 @@ cb_open(void *arg, const char *filename, void **hp) return (errno); } - cf->cf_size = st.st_size; + cf->cf_size = cf->cf_stat.st_size; if (S_ISDIR(cf->cf_stat.st_mode)) { cf->cf_isdir = 1; cf->cf_u.dir = opendir(path);