summaryrefslogtreecommitdiff
path: root/autofd.h
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2015-11-13 16:11:37 -0800
committerZach Reizner <zachr@google.com>2015-11-13 16:11:37 -0800
commitcb1cfc866b47c480a9fa84f6edcc5239ac99d277 (patch)
treed6e02a310e7bfdb5cb40d3ac2bc2e2a1bd707b40 /autofd.h
parent49446bc72b33b8b68352b2048657bea4a8da4a42 (diff)
drm_hwcomposer: avoid creating release fences for invalid OutputFd
This change also adds a check for OutputFd to see if it is valid. Change-Id: If992d523c707cc5e6e660de721938a26f27477d8
Diffstat (limited to 'autofd.h')
-rw-r--r--autofd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/autofd.h b/autofd.h
index 0c4bd66..bc5127a 100644
--- a/autofd.h
+++ b/autofd.h
@@ -91,6 +91,10 @@ struct OutputFd {
return *fd_;
}
+ operator bool() const {
+ return fd_ != NULL;
+ }
+
private:
int *fd_ = NULL;
};