From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Wagner Date: Sun, 08 Jan 2012 13:02:40 +0100 Subject: [U-Boot] [PATCHv3 5/8] mkenvimage: Read/Write from/to stdin/out by default or if the filename is "-" In-Reply-To: <201201080150.09467.vapier@gentoo.org> References: <20120105162831.E91BE1FD3DA@gemini.denx.de> <1325789099-9260-1-git-send-email-david.wagner@free-electrons.com> <1325789099-9260-5-git-send-email-david.wagner@free-electrons.com> <201201080150.09467.vapier@gentoo.org> Message-ID: <4F0985E0.3000107@free-electrons.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 08/01/2012 07:50, Mike Frysinger a ?crit : > On Thursday 05 January 2012 13:44:56 David Wagner wrote: >> + bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP | >> + S_IWGRP); > > this should prob be open() > -mike What is wrong with creat() ? from 'man 2 creat': creat() is equivalent to open() with flags equal to O_CREAT|O_WRONLY|O_TRUNC. We want to create the file if it doesn't exist and truncate it if it does. The only issue I can think of is that no additional flag can be passed to creat(); fcntl can alter some of them. But will we need any ? Regards, David.