From 484b221c0072e2cb06616c60ff2f1c8ef98b3c19 Mon Sep 17 00:00:00 2001 From: naddy Date: Sun, 26 Aug 2018 19:09:55 +0000 Subject: [PATCH] Handle fork() errors. The Perl fork() wrapper returns undef rather than -1 on error. ok jca@ --- usr.bin/libtool/LT/Exec.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/libtool/LT/Exec.pm b/usr.bin/libtool/LT/Exec.pm index 1f74cdd46a2..71cd738b83b 100644 --- a/usr.bin/libtool/LT/Exec.pm +++ b/usr.bin/libtool/LT/Exec.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Exec.pm,v 1.4 2012/07/11 12:54:07 espie Exp $ +# $OpenBSD: Exec.pm,v 1.5 2018/08/26 19:09:55 naddy Exp $ # Copyright (c) 2007-2010 Steven Mestdagh # Copyright (c) 2012 Marc Espie @@ -93,7 +93,7 @@ sub command_run } tsay { "@l" }; my $pid = fork(); - if ($pid == -1) { + if (!defined $pid) { die "Couldn't fork while running @l\n"; } if ($pid == 0) { -- 2.20.1