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>
This commit is contained in:
parent
9f361d5f3e
commit
98e7a432a7
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user