svn commit: r327652 - stable/11/usr.sbin/nandtool
Jilles Tjoelker
jilles at FreeBSD.org
Sat Jan 6 22:59:12 UTC 2018
Author: jilles
Date: Sat Jan 6 22:59:10 2018
New Revision: 327652
URL: https://svnweb.freebsd.org/changeset/base/327652
Log:
MFC r327211: nandtool: Add missing mode for open() with O_CREAT
If O_CREAT is given, open() needs a mode argument. Follow the umask by
passing 0666.
Modified:
stable/11/usr.sbin/nandtool/nand_read.c
stable/11/usr.sbin/nandtool/nand_readoob.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/usr.sbin/nandtool/nand_read.c
==============================================================================
--- stable/11/usr.sbin/nandtool/nand_read.c Sat Jan 6 22:56:48 2018 (r327651)
+++ stable/11/usr.sbin/nandtool/nand_read.c Sat Jan 6 22:59:10 2018 (r327652)
@@ -50,7 +50,7 @@ int nand_read(struct cmd_param *params)
}
if ((out = param_get_string(params, "out"))) {
- out_fd = open(out, O_WRONLY|O_CREAT);
+ out_fd = open(out, O_WRONLY|O_CREAT, 0666);
if (out_fd == -1) {
perrorf("Cannot open %s for writing", out);
return (1);
Modified: stable/11/usr.sbin/nandtool/nand_readoob.c
==============================================================================
--- stable/11/usr.sbin/nandtool/nand_readoob.c Sat Jan 6 22:56:48 2018 (r327651)
+++ stable/11/usr.sbin/nandtool/nand_readoob.c Sat Jan 6 22:59:10 2018 (r327652)
@@ -57,7 +57,7 @@ int nand_read_oob(struct cmd_param *params)
}
if ((out = param_get_string(params, "out"))) {
- if ((fd_out = open(out, O_WRONLY | O_CREAT)) == -1) {
+ if ((fd_out = open(out, O_WRONLY | O_CREAT, 0666)) == -1) {
perrorf("Cannot open %s", out);
ret = 1;
goto out;
More information about the svn-src-all
mailing list