From 874d8d3bbafb3d1919cfc6f21fdb780382f0d015 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 21:03:07 +0100 Subject: boy --- src/ft_music.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/ft_music.c') diff --git a/src/ft_music.c b/src/ft_music.c index f1801f9..a3e2120 100644 --- a/src/ft_music.c +++ b/src/ft_music.c @@ -16,16 +16,14 @@ #include void - ft_music_fork(char **mcmd_words) + ft_music_fork(char **mcmd_words, char *const envp[]) { /* execve(2) here */ + char *arg[3]; - char *arg[4]; - - arg[0] = "/bin/sh"; - arg[1] = "-c"; - arg[2] = "aplay ./media/sound/DEVANT-LES-KAISSONS.wav"; - arg[3] = NULL; + arg[0] = "/usr/bin/aplay"; + arg[1] = "./media/sound/DEVANT-LES-KAISSONS.wav"; + arg[2] = NULL; (void)mcmd_words; - execve("/bin/sh", &arg[0], NULL); + execve("/usr/bin/aplay", &arg[0], envp); } -- cgit v1.2.3