summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Binns <frank.binns@imgtec.com>2020-06-24 11:07:42 +0100
committerFrank Binns <frank.binns@imgtec.com>2020-06-24 11:11:31 +0100
commit77d06f7b8bc40f402468d4a5ab5ac8f935b0b971 (patch)
tree3628aba07468af68c20cdc3ad73f0c9fd0e76a8b
parent6ebda36a3f024207260e0ddcb772a58d84b77ee1 (diff)
downloadweston-77d06f7b8bc40f402468d4a5ab5ac8f935b0b971.tar.gz
shared: fix unused variable warning
Fix the following build warning by moving the 'seals' declaration inside the HAVE_MEMFD_CREATE guard: ../shared/os-compatibility.c: In function ‘os_ro_anonymous_file_get_fd’: ../shared/os-compatibility.c:341:6: warning: unused variable ‘seals’ [-Wunused-variable] int seals, fd; ^ Signed-off-by: Frank Binns <frank.binns@imgtec.com>
-rw-r--r--shared/os-compatibility.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c
index 2e12b7cc..f7610807 100644
--- a/shared/os-compatibility.c
+++ b/shared/os-compatibility.c
@@ -338,10 +338,10 @@ os_ro_anonymous_file_get_fd(struct ro_anonymous_file *file,
enum ro_anonymous_file_mapmode mapmode)
{
void *src, *dst;
- int seals, fd;
+ int fd;
#ifdef HAVE_MEMFD_CREATE
- seals = fcntl(file->fd, F_GET_SEALS);
+ int seals = fcntl(file->fd, F_GET_SEALS);
/* file was sealed for read-only and we don't have to support MAP_SHARED
* so we can simply pass the memfd fd