1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #6694: Check error code of read function (#3208)

(cherry picked from commit 7fe28f226cb86e9d339afb3c0e58ed02c84cd930)
This commit is contained in:
Pavel Czerný 2024-09-04 10:58:15 +02:00 committed by Ruben S. Montero
parent 08e41f1d6f
commit b6898ccc8f
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -314,6 +314,12 @@ int Driver<MSG>
rc = read(from_drv, (void *) buffer, sizeof(char) * 31);
if ( rc < 0 )
{
error = "Driver initialization failed, unable to read from driver\n";
return -1;
}
buffer[rc]='\0';
std::istringstream iss(buffer);
@ -325,7 +331,7 @@ int Driver<MSG>
if ( action != "INIT" || result != "SUCCESS" )
{
error = "Driver initialization failed\n";
error = "Driver initialization failed, expected INIT SUCCESS message\n";
return -1;
}