]> git.ipfire.org Git - thirdparty/libvirt.git/commit
tests: commandhelper: Accept POLLNVAL on macOS
authorRoman Bolshakov <r.bolshakov@yadro.com>
Thu, 8 Oct 2020 14:02:08 +0000 (17:02 +0300)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 8 Oct 2020 15:04:08 +0000 (17:04 +0200)
commitc3d02040ac7de7753b544eb3f3188d97394adb28
tree180309b16dec17b305cd3aca91b8e172643506a9
parent74546bd5fb96e1f19a0a2401b32c3b829d045544
tests: commandhelper: Accept POLLNVAL on macOS

commandhelper hangs indefinitely in poll() on macOS on commandtest test2
and later because POLLNVAL is returned on revents for input file
descriptor opened from /dev/null, i.e this hangs:

  $ tests/commandhelper < /dev/null
  BEGIN STDOUT
  BEGIN STDERR
  ^C

But it works fine with regular stdin:

  $ tests/commandhelper <<< test
  BEGIN STDOUT
  BEGIN STDERR
  test
  test
  END STDOUT
  END STDERR

The issue is mentioned in poll(2):

  BUGS
    The poll() system call currently does not support devices.

With the change all 28 cases in commandtest pass.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tests/commandhelper.c