mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 15:10:10 +01:00
aco: fix printing ASM on GFX6-7 again
Checking errno is actually wrong because it's only updated if
popen() fails (ie. NULL). One solution is to check if the first
line is empty.
Fixes: c95d258d1b ("aco: fix printing ASM on GFX6-7 if clrxdisasm is not found")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5591>
This commit is contained in:
parent
e0518800a1
commit
0aca04afa5
1 changed files with 10 additions and 4 deletions
|
|
@ -69,11 +69,17 @@ void print_asm_gfx6_gfx7(Program *program, std::vector<uint32_t>& binary,
|
|||
sprintf(command, "clrxdisasm --gpuType=%s -r %s", gpu_type, path);
|
||||
|
||||
p = popen(command, "r");
|
||||
if (!p || errno == ENOENT) {
|
||||
out << "clrxdisasm not found\n";
|
||||
} else {
|
||||
while (fgets(line, sizeof(line), p))
|
||||
if (p) {
|
||||
if (!fgets(line, sizeof(line), p)) {
|
||||
out << "clrxdisasm not found\n";
|
||||
pclose(p);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
do {
|
||||
out << line;
|
||||
} while (fgets(line, sizeof(line), p));
|
||||
|
||||
pclose(p);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue