Skip to contentSkip to conversation

trace-cmd: Add missing mode to open() call

PATCH Applied Seth Forshee 2 participants 2 messages Jun 20, 2014 – Jun 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd: Add missing mode to open() call

touch_file() calls open(2) with O_CREAT but omits the required mode argument. Fix this omission.

---
 trace-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace-record.c +1 -1
index d3dd0c5..8438388 100644
@@ -1995,7 +1995,7 @@ static void touch_file(const char *file)
 {
 	int fd;
 
-	fd = open(file, O_WRONLY | O_CREAT | O_TRUNC);
+	fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
 	if (fd < 0)
 		die("could not create file %s\n", file);
 	close(fd);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 4 lines · On Fri, 20 Jun 2014 13:42:29 -0500 Seth Forshee <[email protected]>…

touch_file() calls open(2) with O_CREAT but omits the required mode argument. Fix this omission.

Applied, thanks!

-- Steve

Quoted 17 lines
---
 trace-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
trace-record.c +1 -1
index d3dd0c5..8438388 100644
@@ -1995,7 +1995,7 @@ static void touch_file(const char *file)
 {
 	int fd;
 
-	fd = open(file, O_WRONLY | O_CREAT | O_TRUNC);
+	fd = open(file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
 	if (fd < 0)
 		die("could not create file %s\n", file);
 	close(fd);