Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8199784

Browse filesBrowse files
hmalphettesFishrock123
authored andcommitted
test: fix test-module-loading-error for musl
When a compiled library file does not have the proper format, musl returns the error message ENOEXEC as 'Exec format error' but glibc returns 'file too short' if the file is under a certain size. Reference: http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46 This patch consists of tolerating musl's error. PR-URL: #3657 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
1 parent e5b9109 commit 8199784
Copy full SHA for 8199784

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-module-loading-error.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-module-loading-error.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var error_desc = {
99
linux: 'file too short',
1010
sunos: 'unknown file type'
1111
};
12+
var musl_errno_enoexec = 'Exec format error';
1213

1314
var dlerror_msg = error_desc[process.platform];
1415

@@ -20,6 +21,10 @@ if (!dlerror_msg) {
2021
try {
2122
require('../fixtures/module-loading-error.node');
2223
} catch (e) {
24+
if (process.platform === 'linux' &&
25+
e.toString().indexOf(musl_errno_enoexec) !== -1) {
26+
dlerror_msg = musl_errno_enoexec;
27+
}
2328
assert.notEqual(e.toString().indexOf(dlerror_msg), -1);
2429
}
2530

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.