From 6a89966eed6110d0e7a7ec53727c4473d18ad441 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 20:43:42 +0100 Subject: Fuck execve --- src/ft_music.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/ft_music.c') diff --git a/src/ft_music.c b/src/ft_music.c index 4d25a3a..f1801f9 100644 --- a/src/ft_music.c +++ b/src/ft_music.c @@ -11,19 +11,21 @@ /* ************************************************************************** */ #include -#include +#include #include - #include void - ft_music_fork(char *music_cmd) + ft_music_fork(char **mcmd_words) { - while (1) - { - ft_printf("%s\n", music_cmd); - sleep(1); - } - /* execve here */ - /* system(cl->mlist.music_cmd); */ + /* execve(2) here */ + + char *arg[4]; + + arg[0] = "/bin/sh"; + arg[1] = "-c"; + arg[2] = "aplay ./media/sound/DEVANT-LES-KAISSONS.wav"; + arg[3] = NULL; + (void)mcmd_words; + execve("/bin/sh", &arg[0], NULL); } -- cgit v1.2.3