All of lore.kernel.org
 help / color / mirror / Atom feed
* [TINYCOMPRESS][PATCH] crec: Fix error with opening file using O_CREAT
@ 2014-08-18  8:41 Richard Fitzgerald
  2014-10-17  9:23 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2014-08-18  8:41 UTC (permalink / raw)
  To: vinod.koul; +Cc: alsa-devel, patches, ammar.zhd

From: Ammar Zahid Ali Syed <ammar.zhd@googlemail.com>

The code was not compiling when mode was not passed to open()
while using O_CREAT offset. Passed mode to the open() alongwith
O_CREAT to specify the attributes of file and fix compile issue.

Signed-off-by: Ammar Zahid Ali Syed <ammar.zhd@googlemail.com>
---
 crec.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/crec.c b/crec.c
index 31703c5..e3f189f 100644
--- a/crec.c
+++ b/crec.c
@@ -66,6 +66,8 @@
 #include <stdbool.h>
 #include <getopt.h>
 #include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 #define __force
 #define __bitwise
 #define __user
@@ -256,7 +258,7 @@ void capture_samples(char *name, unsigned int card, unsigned int device,
 	if (verbose)
 		printf("%s: entry, reading %u bytes\n", __func__, length);
 
-	file = open(name, O_RDWR | O_CREAT);
+	file = open(name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
 	if (file == -1) {
 		fprintf(stderr, "Unable to open file '%s'\n", name);
 		exit(EXIT_FAILURE);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-17 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18  8:41 [TINYCOMPRESS][PATCH] crec: Fix error with opening file using O_CREAT Richard Fitzgerald
2014-10-17  9:23 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.