diff options
Diffstat (limited to '')
| -rw-r--r-- | src/ft_exit.c | 5 | ||||
| -rw-r--r-- | src/ft_music.c | 1 | ||||
| -rw-r--r-- | src/ft_warp_level.c | 13 | 
3 files changed, 5 insertions, 14 deletions
| diff --git a/src/ft_exit.c b/src/ft_exit.c index 92da2a6..a63d600 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -64,10 +64,7 @@ int  	if (clist->isoldmus && clist->wlist.inited)  	{  		pthread_cancel(clist->tid); -		if (FT_OS == 1) -			pthread_kill(clist->tid, SIGTERM); -		else -			pthread_join(clist->tid, NULL); +		pthread_join(clist->tid, NULL);  	}  	ft_free_lists(clist);  	ft_printf("Exiting program\n"); diff --git a/src/ft_music.c b/src/ft_music.c index 7688f57..aec5e58 100644 --- a/src/ft_music.c +++ b/src/ft_music.c @@ -23,6 +23,7 @@ void  	cl = (t_cub *)vargp;  	cl->isoldmus = 1; +	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);  	while (1)  		system(cl->mlist.music_cmd);  	return (NULL); diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index a93184c..808b346 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -67,20 +67,14 @@ static void  	if (isoldmus && !cl->mlist.ismusic)  	{  		pthread_cancel(cl->tid); -		if (FT_OS == 1) -			pthread_kill(cl->tid, SIGTERM); -		else -			pthread_join(cl->tid, NULL); +		pthread_join(cl->tid, NULL);  		cl->isoldmus = 0;  	}  	else if (isoldmus && cl->mlist.ismusic  		&& ft_strncmp(tmp_mup, cl->mlist.music_path, ft_strlen(tmp_mup) + 1))  	{  		pthread_cancel(cl->tid); -		if (FT_OS == 1) -			pthread_kill(cl->tid, SIGTERM); -		else -			pthread_join(cl->tid, NULL); +		pthread_join(cl->tid, NULL);  		pthread_create(&cl->tid, NULL, ft_music_thread, cl);  	}  	else if (isoldmus && cl->mlist.ismusic @@ -102,8 +96,7 @@ int8_t  				cl->mlist.nlevel_path) + 1) * sizeof(char))))  			return (-1);  		ft_sprintf(next_path, "%s", cl->mlist.nlevel_path); -		isoldmus = cl->mlist.ismusic; -		if (isoldmus) +		if ((isoldmus = cl->mlist.ismusic))  			tmp_mup = ft_strdup(cl->mlist.music_path);  		ft_del_some(cl);  		ft_del_map(&cl->mlist); | 
