From: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
To: vinod.koul@intel.com
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
ammar.zhd@googlemail.com
Subject: [TINYCOMPRESS][PATCH] crec: Fix error with opening file using O_CREAT
Date: Mon, 18 Aug 2014 09:41:58 +0100 [thread overview]
Message-ID: <20140818084158.GA14810@opensource.wolfsonmicro.com> (raw)
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
next reply other threads:[~2014-08-18 8:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-18 8:41 Richard Fitzgerald [this message]
2014-10-17 9:23 ` [TINYCOMPRESS][PATCH] crec: Fix error with opening file using O_CREAT Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140818084158.GA14810@opensource.wolfsonmicro.com \
--to=rf@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=ammar.zhd@googlemail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox