projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make it really clear that wangle/rx is deprecated
[folly.git]
/
folly
/
File.cpp
diff --git
a/folly/File.cpp
b/folly/File.cpp
index 2f239c2ace035c7a1c8f8845b1f68debbcb7a211..253d005472a0a80f52c5bb67452071d0b9538c69 100644
(file)
--- a/
folly/File.cpp
+++ b/
folly/File.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
4
Facebook, Inc.
+ * Copyright 201
5
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-18,6
+18,7
@@
#include <fcntl.h>
#include <unistd.h>
#include <fcntl.h>
#include <unistd.h>
+#include <sys/file.h>
#include <folly/Exception.h>
#include <folly/FileUtil.h>
#include <folly/Exception.h>
#include <folly/FileUtil.h>
@@
-65,7
+66,11
@@
File& File::operator=(File&& other) {
}
File::~File() {
}
File::~File() {
- closeNoThrow(); // ignore error
+ auto fd = fd_;
+ if (!closeNoThrow()) { // ignore most errors
+ DCHECK_NE(errno, EBADF) << "closing fd " << fd << ", it may already "
+ << "have been closed. Another time, this might close the wrong FD.";
+ }
}
/* static */ File File::temporary() {
}
/* static */ File File::temporary() {