From patchwork Mon Aug 18 08:41:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 4733551 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C896A9F344 for ; Mon, 18 Aug 2014 08:44:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 063C120108 for ; Mon, 18 Aug 2014 08:44:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 367FD2010E for ; Mon, 18 Aug 2014 08:44:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3FFA12654FF; Mon, 18 Aug 2014 10:44:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1A50D2654BD; Mon, 18 Aug 2014 10:44:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 50E692654BD; Mon, 18 Aug 2014 10:44:05 +0200 (CEST) Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 66B2F26574C for ; Mon, 18 Aug 2014 10:42:02 +0200 (CEST) Received: from opensource.wolfsonmicro.com (opensource [80.75.67.52]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id ED039111104; Mon, 18 Aug 2014 09:42:01 +0100 (BST) Date: Mon, 18 Aug 2014 09:41:58 +0100 From: Richard Fitzgerald To: vinod.koul@intel.com Message-ID: <20140818084158.GA14810@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, ammar.zhd@googlemail.com Subject: [alsa-devel] [TINYCOMPRESS][PATCH] crec: Fix error with opening file using O_CREAT X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ammar Zahid Ali Syed 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 --- 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 #include #include +#include +#include #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);