ft_exit.c 1.0 KB

123456789101112131415161718192021
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_exit.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2016/01/23 20:00:55 by bchanot #+# #+# */
  9. /* Updated: 2018/10/29 12:15:07 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "libft.h"
  13. #include <stdlib.h>
  14. void ft_exit(const char *const s, int fd)
  15. {
  16. if (s)
  17. ft_putendl_fd(s, fd);
  18. exit(fd == 1 ? EXIT_SUCCESS : EXIT_FAILURE);
  19. }