aboutsummaryrefslogtreecommitdiff
path: root/philo_two/src/routine.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-05 17:00:51 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-05 17:00:51 +0200
commit47e1a7b4af69e1998182126310e42af83cf214ed (patch)
treeaedb74e78e9fdbd7a6593ea773d47364bd158e61 /philo_two/src/routine.c
parent473cf5d7576744b679b7a504232b5ebd4b5d689f (diff)
downloadphilosophers-47e1a7b4af69e1998182126310e42af83cf214ed.tar.gz
philosophers-47e1a7b4af69e1998182126310e42af83cf214ed.tar.bz2
philosophers-47e1a7b4af69e1998182126310e42af83cf214ed.zip
Norming and destroy on error
Diffstat (limited to 'philo_two/src/routine.c')
-rw-r--r--philo_two/src/routine.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/philo_two/src/routine.c b/philo_two/src/routine.c
index 8fe13a1..fd31ca2 100644
--- a/philo_two/src/routine.c
+++ b/philo_two/src/routine.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 23:00:07 by cacharle #+# #+# */
-/* Updated: 2020/10/05 14:30:52 by cacharle ### ########.fr */
+/* Updated: 2020/10/05 16:03:38 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -50,16 +50,16 @@ void *routine_death(t_philo *arg)
t_philo *routine_create_philos(t_philo_conf *conf, sem_t *forks)
{
int i;
- t_philo *routine_conf;
+ t_philo *philos;
- if ((routine_conf = malloc(sizeof(t_philo) * conf->philo_num)) == NULL)
+ if ((philos = malloc(sizeof(t_philo) * conf->philo_num)) == NULL)
return (NULL);
i = -1;
while (++i < conf->philo_num)
{
- routine_conf[i].id = i + 1;
- routine_conf[i].forks = forks;
- routine_conf[i].conf = conf;
+ philos[i].id = i + 1;
+ philos[i].forks = forks;
+ philos[i].conf = conf;
}
- return (routine_conf);
+ return (philos);
}