diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-05 17:00:51 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-05 17:00:51 +0200 |
| commit | 47e1a7b4af69e1998182126310e42af83cf214ed (patch) | |
| tree | aedb74e78e9fdbd7a6593ea773d47364bd158e61 /common/helper.c | |
| parent | 473cf5d7576744b679b7a504232b5ebd4b5d689f (diff) | |
| download | philosophers-47e1a7b4af69e1998182126310e42af83cf214ed.tar.gz philosophers-47e1a7b4af69e1998182126310e42af83cf214ed.tar.bz2 philosophers-47e1a7b4af69e1998182126310e42af83cf214ed.zip | |
Norming and destroy on error
Diffstat (limited to 'common/helper.c')
| -rw-r--r-- | common/helper.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/common/helper.c b/common/helper.c index b2107ae..9f29ad9 100644 --- a/common/helper.c +++ b/common/helper.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/08 23:22:49 by cacharle #+# #+# */ -/* Updated: 2020/09/30 10:15:14 by cacharle ### ########.fr */ +/* Updated: 2020/10/05 15:28:35 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -36,11 +36,15 @@ long int h_atou_strict(char *s) return (num); } +/* +** No need to check error of gettimeofday +** (only for settimeofday and passed pointer validity) +*/ + t_time h_time_now(void) { struct timeval tv; - if (gettimeofday(&tv, NULL) == -1) - return (-1); + gettimeofday(&tv, NULL); return (tv.tv_sec * 1000 + tv.tv_usec / 1000); } |
