1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

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

This commit is contained in:
Pavel Czerný 2024-09-04 10:58:15 +02:00 committed by GitHub
parent cd9eb49321
commit 7fe28f226c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
}