From: Vinod Koul <vinod.koul@intel.com>
To: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
ammar.zhd@googlemail.com
Subject: Re: [TINYCOMPRESS][PATCH] crec: Fix error with opening file using O_CREAT
Date: Fri, 17 Oct 2014 14:53:34 +0530 [thread overview]
Message-ID: <20141017092334.GQ1638@intel.com> (raw)
In-Reply-To: <20140818084158.GA14810@opensource.wolfsonmicro.com>
On Mon, Aug 18, 2014 at 09:41:58AM +0100, Richard Fitzgerald wrote:
> 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.
>
Sorry this slipped thru earlier.
Applied, now
Thanks
--
~Vinod
> 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
>
--
prev parent reply other threads:[~2014-10-17 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=20141017092334.GQ1638@intel.com \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=ammar.zhd@googlemail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=rf@opensource.wolfsonmicro.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