Skip to contentSkip to conversation

Add no-mmu support for alsa-utils

PATCH New Aaron Wu 1 participant 1 message Dec 4, 2013

lore
Share & tools
lore

Aaron Wu

author
#0 lore raw

PATCH 1/1 Add no-mmu support for alsa-utils

From: Aaron Wu <[email protected]>

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(+)
alsactl/init_utils_run.c +4 -0
index dde490b..ac074e6 100644
@@ -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 */
alsaloop/alsaloop.c +8 -0
index 3b20682..1b1e540 100644
@@ -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
 		}
 	}
 
configure.in +1 -0
index 60da1fa..f289f9b 100644
@@ -25,6 +25,7 @@ then
   AC_MSG_RESULT($CC)
 fi
 
+AC_CHECK_FUNC([fork])
 AC_PROG_CC
 dnl AC_PROG_CXX
 AC_PROG_INSTALL
Signature · 1 line
1.7.9.5