Skip to content
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

Ignore sigpipe to prevent SIGPIPE in CloudSQLite which crashes the process #944

Merged
merged 6 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions iModelJsNodeAddon/IModelJsNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#include <Napi/napi.h>
#include <DgnPlatform/DgnGeoCoord.h>
#include "DgnDbWorker.h"
#ifndef BENTLEY_WIN32
#include <signal.h>
#endif

USING_NAMESPACE_BENTLEY
USING_NAMESPACE_BENTLEY_SQLITE
Expand Down
4 changes: 4 additions & 0 deletions iModelJsNodeAddon/JsCloudSqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,10 @@ void registerCloudSqlite(Napi::Env env, Napi::Object exports) {
JsCloudCache::Init(env, exports);
JsCloudContainer::Init(env, exports);
JsCloudPrefetch::Init(env, exports);
#ifndef BENTLEY_WIN32
// Ignore SIGPIPE to prevent crashes in CloudSQLite/curl.
signal(SIGPIPE, SIG_IGN);
#endif
}

} // end namespace IModelJsNative