Date: Tue, 26 Dec 2017 16:20:39 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327211 - head/usr.sbin/nandtool Message-ID: <201712261620.vBQGKd0r068760@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Tue Dec 26 16:20:38 2017 New Revision: 327211 URL: https://svnweb.freebsd.org/changeset/base/327211 Log: 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. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13607 Modified: head/usr.sbin/nandtool/nand_read.c head/usr.sbin/nandtool/nand_readoob.c Modified: head/usr.sbin/nandtool/nand_read.c ============================================================================== --- head/usr.sbin/nandtool/nand_read.c Tue Dec 26 16:13:20 2017 (r327210) +++ head/usr.sbin/nandtool/nand_read.c Tue Dec 26 16:20:38 2017 (r327211) @@ -52,7 +52,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: head/usr.sbin/nandtool/nand_readoob.c ============================================================================== --- head/usr.sbin/nandtool/nand_readoob.c Tue Dec 26 16:13:20 2017 (r327210) +++ head/usr.sbin/nandtool/nand_readoob.c Tue Dec 26 16:20:38 2017 (r327211) @@ -59,7 +59,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?201712261620.vBQGKd0r068760>