Patchwork [mtd-utils] creat(2) expects a creation mode parameter, not an open flag

login
register
mail settings
Submitter Ferenc Wagner
Date March 7, 2010, 9:15 p.m.
Message ID <87sk8bzvch.fsf@tac.ki.iif.hu>
Download mbox | patch
Permalink /patch/47096/
State Accepted
Commit 4f8c7a0e925c904b37f590b2513824c6d6bba85f
Headers show

Comments

Ferenc Wagner - March 7, 2010, 9:15 p.m.
Signed-off-by: Ferenc Wagner <wferi@niif.hu>
---
 mtd_debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - April 1, 2010, 12:51 p.m.
On Sun, 2010-03-07 at 22:15 +0100, Ferenc Wagner wrote:
> creat(2) expects a creation mode parameter, not an open flag

Pushed to the mtd-utils tree, thanks.

Patch

diff --git a/mtd_debug.c b/mtd_debug.c
index 85d48e9..49a4567 100644
--- a/mtd_debug.c
+++ b/mtd_debug.c
@@ -110,7 +110,7 @@  int flash_to_file (int fd,u_int32_t offset,size_t len,const char *filename)
 		perror ("lseek()");
 		goto err0;
 	}
-	outfd = creat (filename,O_WRONLY);
+	outfd = creat (filename,0666);
 	if (outfd < 0)
 	{
 		perror ("creat()");