alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Wu <aaron.wu@analog.com>
To: adi-buildroot-devel@lists.sourceforge.net, alsa-devel@alsa-project.org
Cc: Aaron Wu <Aaron.wu@analog.com>
Subject: [PATCH] Add no-mmu support for alsa-utils
Date: Wed, 4 Dec 2013 16:36:30 +0800	[thread overview]
Message-ID: <1386146190-2780-1-git-send-email-aaron.wu@analog.com> (raw)

From: Aaron Wu <Aaron.wu@analog.com>

Signed-off-by: Aaron Wu <Aaron.wu@analog.com>

Add no-mmu support for alsa-utils mainly for Blackfin
---
 alsactl/init_utils_run.c |    4 ++++
 alsaloop/alsaloop.c      |    8 ++++++++
 configure.in             |    1 +
 3 files changed, 13 insertions(+)

diff --git a/alsactl/init_utils_run.c b/alsactl/init_utils_run.c
index dde490b..ac074e6 100644
--- a/alsactl/init_utils_run.c
+++ b/alsactl/init_utils_run.c
@@ -89,7 +89,11 @@ int run_program0(struct space *space,
 		argv[0] = program;
 	}
 
+	#ifdef HAVE_FORK
 	pid = fork();
+	#else
+	pid = vfork();
+	#endif
 	switch(pid) {
 	case 0:
 		/* child closes parent ends of pipes */
diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c
index 3b20682..1b1e540 100644
--- a/alsaloop/alsaloop.c
+++ b/alsaloop/alsaloop.c
@@ -861,14 +861,22 @@ int main(int argc, char *argv[])
 			logit(LOG_CRIT, "daemon() failed: %s\n", strerror(errno));
 			exit(EXIT_FAILURE);
 		}
+		#ifdef HAVE_FORK
 		i = fork();
+		#else
+		i = vfork();
+		#endif
 		if (i < 0) {
 			logit(LOG_CRIT, "fork() failed: %s\n", strerror(errno));
 			exit(EXIT_FAILURE);
 		}
 		if (i > 0) {
 			/* wait(&i); */
+			#ifdef HAVE_FORK
 			exit(EXIT_SUCCESS);
+			#else
+			_exit(EXIT_SUCCESS);
+			#endif
 		}
 	}
 
diff --git a/configure.in b/configure.in
index 60da1fa..f289f9b 100644
--- a/configure.in
+++ b/configure.in
@@ -25,6 +25,7 @@ then
   AC_MSG_RESULT($CC)
 fi
 
+AC_CHECK_FUNC([fork])
 AC_PROG_CC
 dnl AC_PROG_CXX
 AC_PROG_INSTALL
-- 
1.7.9.5

                 reply	other threads:[~2013-12-04  8:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1386146190-2780-1-git-send-email-aaron.wu@analog.com \
    --to=aaron.wu@analog.com \
    --cc=adi-buildroot-devel@lists.sourceforge.net \
    --cc=alsa-devel@alsa-project.org \
    /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;
as well as URLs for NNTP newsgroup(s).