aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_music.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-06 21:03:07 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-06 21:03:07 +0100
commit874d8d3bbafb3d1919cfc6f21fdb780382f0d015 (patch)
tree6e1f455634bb1b5810e50e2c6e9e3515954ccf29 /src/ft_music.c
parentFuck execve (diff)
download42-cub3d-874d8d3bbafb3d1919cfc6f21fdb780382f0d015.tar.gz
42-cub3d-874d8d3bbafb3d1919cfc6f21fdb780382f0d015.tar.bz2
42-cub3d-874d8d3bbafb3d1919cfc6f21fdb780382f0d015.tar.xz
42-cub3d-874d8d3bbafb3d1919cfc6f21fdb780382f0d015.tar.zst
42-cub3d-874d8d3bbafb3d1919cfc6f21fdb780382f0d015.zip
boy
Diffstat (limited to 'src/ft_music.c')
-rw-r--r--src/ft_music.c14
1 files changed, 6 insertions, 8 deletions
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 <unistd.h>
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);
}