diff options
author | Rikus Wessels <rikus@umantec.net> | 2016-06-09 09:30:45 +0200 |
---|---|---|
committer | Rikus Wessels <rikus@umantec.net> | 2016-06-09 09:30:45 +0200 |
commit | df981c7282171c9a878ef49c0169d91060317ea0 (patch) | |
tree | 3c52e39459a5b2a2c7f26cc34e71dc750ebf0346 /examples | |
parent | a37bef639c9b214400819b20bcfa3e0dfa7810b8 (diff) | |
download | Open-AVB-df981c7282171c9a878ef49c0169d91060317ea0.tar.gz |
Changed to if (NULL ==
Diffstat (limited to 'examples')
-rw-r--r-- | examples/common/avb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/common/avb.c b/examples/common/avb.c index f3bc43f5..2af99a33 100644 --- a/examples/common/avb.c +++ b/examples/common/avb.c @@ -102,7 +102,7 @@ out: int gptpinit(int *shm_fd, char **shm_map) { - if (shm_fd == NULL || shm_map == NULL) { + if (NULL == shm_fd || NULL == shm_map) { return -1; } *shm_fd = shm_open(SHM_NAME, O_RDWR, 0); @@ -112,7 +112,7 @@ int gptpinit(int *shm_fd, char **shm_map) } *shm_map = (char *)mmap(NULL, SHM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, *shm_fd, 0); - if (*shm_map == (char *)-1) { + if ((char*)-1 == *shm_map) { perror("mmap()"); *shm_map = NULL; shm_unlink(SHM_NAME); @@ -134,7 +134,7 @@ int gptpinit(int *shm_fd, char **shm_map) int gptpdeinit(int *shm_fd, char **shm_map) { int ret = 0; - if (shm_fd == NULL) { + if (NULL == shm_fd) { ret -= 1; }else if (*shm_fd != -1) { if(close(*shm_fd) == -1) { @@ -142,7 +142,7 @@ int gptpdeinit(int *shm_fd, char **shm_map) } *shm_fd = -1; } - if (shm_map == NULL) { + if (NULL == shm_map) { ret -= 2; }else if (NULL != *shm_map) { if (munmap(*shm_map, SHM_SIZE) == -1) { |