Skip to content

Commit

Permalink
Ignore sigpipe to prevent SIGPIPE in CloudSQLite which crashes the pr…
Browse files Browse the repository at this point in the history
…ocess (#944) (#949)

* ignore sigpipe: no idea if this is the appropriate place to do it

* update comment

(cherry picked from commit 3574f5b)

Co-authored-by: Nick Tessier <22119573+nick4598@users.noreply.github.com>
  • Loading branch information
mergify[bot] and nick4598 authored Jan 3, 2025
1 parent c4cd309 commit 317de9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit 317de9c

Please sign in to comment.