diff options
author | brueffer <brueffer@FreeBSD.org> | 2015-07-21 14:25:21 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2015-07-21 14:25:21 +0000 |
commit | 77896922f6d2552355c5dd628cb8caf2715e0bc7 (patch) | |
tree | 4dfd1630e9799c5877fe0c3abb0f9e682a006869 | |
parent | 0dafb147a9f694fe943d5634209b52b90a360dcc (diff) | |
download | FreeBSD-src-77896922f6d2552355c5dd628cb8caf2715e0bc7.zip FreeBSD-src-77896922f6d2552355c5dd628cb8caf2715e0bc7.tar.gz |
MFC: r285531
Unbreak ggatec and ggatel on i386 after r238119, which added two more
'struct g_gate_ctl_create' fields.
While the behaviour was technically undefined on other architectures
as well, on the reporter's amd64 systems the uninitialized bytes the
kernel cares about were always zero so everything worked as expected.
PR: 197309, 199559
Submitted by: ota@j.email.ne.jp, Fabian Keil
Reviewed by: pjd
Approved by: re (gjb)
-rw-r--r-- | sbin/ggate/ggatec/ggatec.c | 1 | ||||
-rw-r--r-- | sbin/ggate/ggatel/ggatel.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sbin/ggate/ggatec/ggatec.c b/sbin/ggate/ggatec/ggatec.c index 6f9263c..ea4f701 100644 --- a/sbin/ggate/ggatec/ggatec.c +++ b/sbin/ggate/ggatec/ggatec.c @@ -447,6 +447,7 @@ g_gatec_create(void) /* * Ok, got both sockets, time to create provider. */ + memset(&ggioc, 0, sizeof(ggioc)); ggioc.gctl_version = G_GATE_VERSION; ggioc.gctl_mediasize = mediasize; ggioc.gctl_sectorsize = sectorsize; diff --git a/sbin/ggate/ggatel/ggatel.c b/sbin/ggate/ggatel/ggatel.c index abfe7c1..0b89df0 100644 --- a/sbin/ggate/ggatel/ggatel.c +++ b/sbin/ggate/ggatel/ggatel.c @@ -173,6 +173,7 @@ g_gatel_create(void) fd = open(path, g_gate_openflags(flags) | O_DIRECT | O_FSYNC); if (fd == -1) err(EXIT_FAILURE, "Cannot open %s", path); + memset(&ggioc, 0, sizeof(ggioc)); ggioc.gctl_version = G_GATE_VERSION; ggioc.gctl_unit = unit; ggioc.gctl_mediasize = g_gate_mediasize(fd); |