mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-07 03:04:49 +00:00
Misc: life_mngr clear compile warning
As Makefile's strict check, clear compile warnings for life_mngr. Tracked-On: #3564 Signed-off-by: fuyanX <yanx.fu@intel.com> Acked-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
parent
91366b876c
commit
df5ef925bf
@ -69,6 +69,7 @@ int main(int argc, char *argv[])
|
|||||||
int fd_uos = 0;
|
int fd_uos = 0;
|
||||||
unsigned char recvbuf[BUFF_SIZE];
|
unsigned char recvbuf[BUFF_SIZE];
|
||||||
enum nodetype node = NODE_UNKNOWN;
|
enum nodetype node = NODE_UNKNOWN;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (argc <= 2) {
|
if (argc <= 2) {
|
||||||
printf("Too few options. Example: [./life_mngr uos /dev/ttyS1].\n");
|
printf("Too few options. Example: [./life_mngr uos /dev/ttyS1].\n");
|
||||||
@ -98,16 +99,19 @@ int main(int argc, char *argv[])
|
|||||||
do {
|
do {
|
||||||
if (node == NODE_UOS_SERVER) {
|
if (node == NODE_UOS_SERVER) {
|
||||||
memset(recvbuf, 0, sizeof(recvbuf));
|
memset(recvbuf, 0, sizeof(recvbuf));
|
||||||
read(fd_uos, recvbuf, sizeof(recvbuf));
|
ret = read(fd_uos, recvbuf, sizeof(recvbuf));
|
||||||
|
|
||||||
if (strncmp(SOS_REQ, recvbuf, MSG_SIZE) == 0) {
|
if (strncmp(SOS_REQ, (const char *)recvbuf, MSG_SIZE) == 0) {
|
||||||
write(fd_uos, UOS_ACK, sizeof(UOS_ACK));
|
ret = write(fd_uos, UOS_ACK, sizeof(UOS_ACK));
|
||||||
|
if (ret != sizeof(UOS_ACK)) {
|
||||||
|
printf("UOS acked fail\n");
|
||||||
|
}
|
||||||
printf("SOS start shutdown\n");
|
printf("SOS start shutdown\n");
|
||||||
system("poweroff");
|
ret = system("poweroff");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user