]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/nntpd.t: fix fcntl test to ensure no failures
authorEric Wong <e@80x24.org>
Tue, 22 Sep 2015 10:09:42 +0000 (10:09 +0000)
committerEric Wong <e@80x24.org>
Tue, 22 Sep 2015 22:12:15 +0000 (22:12 +0000)
We need to run the syscall before testing for its failure :x

t/nntpd.t

index d30ed63f9fb04baf4c66d93adec93854465354b4..d886e3c65e71949996decace5456859ea5fa5162 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -88,8 +88,8 @@ EOF
        }
        ok(defined $pid, 'forked nntpd process successfully');
        $! = 0;
-       ok(! $!, 'no error from fcntl(F_SETFD)');
        fcntl($sock, F_SETFD, $fl |= FD_CLOEXEC);
+       ok(! $!, 'no error from fcntl(F_SETFD)');
        my $n = Net::NNTP->new($sock->sockhost . ':' . $sock->sockport);
        my $list = $n->list;
        is_deeply($list, { $group => [ qw(1 1 n) ] }, 'LIST works');