OSDN Git Service

drm_hwcomposer: Break out of sync_wait loop on success
[android-x86/external-drm_hwcomposer.git] / autofd.h
index 0c4bd66..1edc9c5 100644 (file)
--- a/autofd.h
+++ b/autofd.h
@@ -14,6 +14,9 @@
  * limitations under the License.
  */
 
+#ifndef ANDROID_AUTO_FD_H_
+#define ANDROID_AUTO_FD_H_
+
 #include <unistd.h>
 
 namespace android {
@@ -91,7 +94,13 @@ struct OutputFd {
     return *fd_;
   }
 
+  operator bool() const {
+    return fd_ != NULL;
+  }
+
  private:
   int *fd_ = NULL;
 };
 }
+
+#endif