Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jan 2018 22:59:10 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r327652 - stable/11/usr.sbin/nandtool
Message-ID:  <201801062259.w06MxAjp001695@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801062259.w06MxAjp001695>