mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 06:19:24 +00:00
dm: refine assert usage
Remove unnecessary assert and add error handling when required. Tracked-On: #3252 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
0a8bf6cee4
commit
56469f3edc
@@ -30,7 +30,6 @@
|
||||
* Micro event library for FreeBSD, designed for a single i/o thread
|
||||
* using EPOLL, and having events be persistent by default.
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -377,7 +376,6 @@ int
|
||||
mevent_init(void)
|
||||
{
|
||||
epoll_fd = epoll_create1(0);
|
||||
assert(epoll_fd >= 0);
|
||||
|
||||
if (epoll_fd >= 0)
|
||||
return 0;
|
||||
@@ -420,7 +418,10 @@ mevent_dispatch(void)
|
||||
* Add internal event handler for the pipe write fd
|
||||
*/
|
||||
pipev = mevent_add(mevent_pipefd[0], EVF_READ, mevent_pipe_read, NULL, NULL, NULL);
|
||||
assert(pipev != NULL);
|
||||
if (!pipev) {
|
||||
fprintf(stderr, "pipefd mevent_add failed\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
int suspend_mode;
|
||||
|
Reference in New Issue
Block a user