-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Remove readdir_r
in favor of readdir
#422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove readdir_r
in favor of readdir
#422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just tiny nit
int rc = readdir_r(current_dir.dir_, &entry, &result); | ||
if (0 != rc) { | ||
errno = 0; | ||
struct dirent* entry = readdir(current_dir.dir_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: struct not needed in C++ code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
`readdir_r` has been considered harmful for a while now and it's deprecated by glibc since 2.24. I know `readdir_r` was historically the thread-safe alternative but even if POSIX don't require `readdir` to be thread-safe, it is thread-safe in any modern implementation such as glibc. Note that the docs says that the next POSIX spec will require `readdir` to be thread-safe "officially".
3cd1516
to
50ef17f
Compare
Automatic merge from submit-queue. [DO NOT MERGE] Auto PR to update dependencies of mixerclient This PR will be merged automatically once checks are successful. ```release-note none ```
…yproxy#422) Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Backport envoyproxy/envoy-wasm#422 and its prerequisite (envoyproxy#10009). * Plumb the flaky flag from envoy_cc_test to the native.cc_test (envoyproxy#10009) Signed-off-by: Yan Avlasov <yavlasov@google.com> * ci: mark //test/integration:protocol_integration_test as flaky. (envoyproxy#422) Signed-off-by: Piotr Sikora <piotrsikora@google.com>
…yproxy#422) Signed-off-by: Piotr Sikora <piotrsikora@google.com>
…o#162) Backport envoyproxy/envoy-wasm#422 and its prerequisite (envoyproxy#10009). * Plumb the flaky flag from envoy_cc_test to the native.cc_test (envoyproxy#10009) Signed-off-by: Yan Avlasov <yavlasov@google.com> * ci: mark //test/integration:protocol_integration_test as flaky. (envoyproxy#422) Signed-off-by: Piotr Sikora <piotrsikora@google.com>
…fixes. (#180) * Revert "fix opencensus tracer (#155)" This reverts commit 063eeb9. * Revert "Add x-goog-user-proj header for sts credential (#152)" This reverts commit 37dbbd4. * Revert "Update GrpcService to add StsService. (envoyproxy#411)" This reverts commit ab59731. * Revert "fix tracer ssl credential (#151)" This reverts commit 02901d0. * Revert "remove url validation as it is not implemented" This reverts commit 3eb2101. * Revert "Use gRPC Security Token Service (STS) to get call credentials (envoyproxy#9101)" This reverts commit ec6b907. * Revert "[release-1.4] Use sts for call credential when STS_PORT is provided in node metadata #144 (#148)" This reverts commit 7081e43. * Revert "Upgrade gRPC to 1.25 which has gRPC STS feature (#145)" This reverts commit 03ecfad. * ci: mark //test/integration:protocol_integration_test as flaky. (#162) Backport envoyproxy/envoy-wasm#422 and its prerequisite (envoyproxy#10009). * Plumb the flaky flag from envoy_cc_test to the native.cc_test (envoyproxy#10009) Signed-off-by: Yan Avlasov <yavlasov@google.com> * ci: mark //test/integration:protocol_integration_test as flaky. (envoyproxy#422) Signed-off-by: Piotr Sikora <piotrsikora@google.com> * Remove wasm filter stress test Signed-off-by: gargnupur <gargnupur@google.com> * Remove wasm stress test framework Signed-off-by: gargnupur <gargnupur@google.com> Co-authored-by: Piotr Sikora <piotrsikora@google.com> Co-authored-by: Nupur Garg <37600866+gargnupur@users.noreply.github.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
readdir_r
has been considered harmful for a while now and it's deprecated by glibc since 2.24. I knowreaddir_r
was historically the thread-safe alternative but even if POSIX doesn't requirereaddir
to be thread-safe, it is thread-safe in any modern implementation including glibc.Note that the docs say that the next POSIX spec will require
readdir
to be thread-safe "officially".