Cygwin: testsuite: Just log result of second open of /dev/dsp

Do not rate successful second open of /dev/dsp as an error, just log the
result.

Based on this patch by Gerd Spalink:

https://cygwin.com/pipermail/cygwin-patches/2004q3/004848.html
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon Turney 2023-07-07 13:36:29 +01:00
parent 9776357323
commit 7c0750e962
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
1 changed files with 6 additions and 14 deletions

View File

@ -170,15 +170,11 @@ playbacktest (void)
strerror (errno));
}
audio2 = open ("/dev/dsp", O_WRONLY);
tst_resm (TINFO, "Second open /dev/dsp W %s ",
audio2 >= 0 ? "WORKS" : "DOESN'T WORK");
if (audio2 >= 0)
{
tst_brkm (TFAIL, cleanup,
"Second open /dev/dsp W succeeded, but is expected to fail");
}
else if (errno != EBUSY)
{
tst_brkm (TFAIL, cleanup, "Expected EBUSY here, exit: %s",
strerror (errno));
close (audio2);
}
for (rate = 0; rate < sizeof (rates) / sizeof (int); rate++)
for (k = 0; k < sizeof (sblut) / sizeof (struct sb); k++)
@ -209,15 +205,11 @@ recordingtest (void)
strerror (errno));
}
audio2 = open ("/dev/dsp", O_RDONLY);
tst_resm (TINFO, "Second open /dev/dsp R %s",
audio2 >= 0 ? "WORKS" : "DOESN'T WORK");
if (audio2 >= 0)
{
tst_brkm (TFAIL, cleanup,
"Second open /dev/dsp R succeeded, but is expected to fail");
}
else if (errno != EBUSY)
{
tst_brkm (TFAIL, cleanup, "Expected EBUSY here, exit: %s",
strerror (errno));
close (audio2);
}
for (rate = 0; rate < sizeof (rates) / sizeof (int); rate++)
for (k = 0; k < sizeof (sblut) / sizeof (struct sb); k++)