Date: Sat, 11 Apr 2009 14:43:23 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r190930 - head/sbin/newfs_msdos Message-ID: <200904111443.n3BEhNpC089333@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sat Apr 11 14:43:22 2009 New Revision: 190930 URL: http://svn.freebsd.org/changeset/base/190930 Log: Fix a bug in r185587. fstat(fd, &sb) was not executed unconditionally anymore so sb was read uninitialised when -C is used. Submitted by: Christoph Mallon <christoph mallon gmx de> Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:33:10 2009 (r190929) +++ head/sbin/newfs_msdos/newfs_msdos.c Sat Apr 11 14:43:22 2009 (r190930) @@ -363,8 +363,9 @@ main(int argc, char *argv[]) errx(1, "failed to create %s", fname); if (ftruncate(fd, opt_create)) errx(1, "failed to initialize %jd bytes", (intmax_t)opt_create); - } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1 || - fstat(fd, &sb)) + } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1) + err(1, "%s", fname); + if (fstat(fd, &sb)) err(1, "%s", fname); if (!opt_N) check_mounted(fname, sb.st_mode);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904111443.n3BEhNpC089333>