diff options
author | John Högberg <[email protected]> | 2019-03-25 13:03:49 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-03-29 12:51:54 +0100 |
commit | f26340035f0bded68c9eefbd3a534d8a5f428e36 (patch) | |
tree | f063ee163a1211d099b964a2cf3953a55a2d0648 | |
parent | 83fb1f13596977beab8b426a23813d73d71f9c17 (diff) | |
download | otp-f26340035f0bded68c9eefbd3a534d8a5f428e36.tar.gz otp-f26340035f0bded68c9eefbd3a534d8a5f428e36.tar.bz2 otp-f26340035f0bded68c9eefbd3a534d8a5f428e36.zip |
file_SUITE: Ignore EILSEQ on Darwin in +fnu/latin1 test
There's no way to create the file in question, so we may as well
skip the test.
-rw-r--r-- | erts/emulator/beam/erl_posix_str.c | 3 | ||||
-rw-r--r-- | lib/kernel/test/file_SUITE.erl | 34 |
2 files changed, 27 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_posix_str.c b/erts/emulator/beam/erl_posix_str.c index 7b3e640d3f..5b515d6e78 100644 --- a/erts/emulator/beam/erl_posix_str.c +++ b/erts/emulator/beam/erl_posix_str.c @@ -171,6 +171,9 @@ erl_errno_id(error) #if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS)) case EIDRM: return "eidrm"; #endif +#ifdef EILSEQ + case EILSEQ: return "eilseq"; +#endif #ifdef EINIT case EINIT: return "einit"; #endif diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl index 711ffccb67..e095e589a3 100644 --- a/lib/kernel/test/file_SUITE.erl +++ b/lib/kernel/test/file_SUITE.erl @@ -3744,19 +3744,33 @@ otp_10852(Config) when is_list(Config) -> ok = rpc_call(Node, read_file, [B]), ok = rpc_call(Node, make_link, [B,B]), case rpc_call(Node, make_symlink, [B,B]) of - ok -> ok; - {error, E} when (E =:= enotsup) or (E =:= eperm) -> - {win32,_} = os:type() + {error, eilseq} -> + %% Some versions of OS X refuse to create files with illegal names. + {unix,darwin} = os:type(); + {error, eperm} -> + %% The test user might not have permission to create symlinks. + {win32,_} = os:type(); + ok -> + ok end, ok = rpc_call(Node, delete, [B]), - ok = rpc_call(Node, make_dir, [B]), + case rpc_call(Node, make_dir, [B]) of + {error, eilseq} -> + {unix,darwin} = os:type(); + ok -> + ok + end, ok = rpc_call(Node, del_dir, [B]), - ok = rpc_call(Node, write_file, [B,B]), - {ok, Fd} = rpc_call(Node, open, [B,[read]]), - ok = rpc_call(Node, close, [Fd]), - {ok,0} = rpc_call(Node, copy, [B,B]), - {ok, Fd2, B} = rpc_call(Node, path_open, [["."], B, [read]]), - ok = rpc_call(Node, close, [Fd2]), + case rpc_call(Node, write_file, [B,B]) of + {error, eilseq} -> + {unix,darwin} = os:type(); + ok -> + {ok, Fd} = rpc_call(Node, open, [B,[read]]), + ok = rpc_call(Node, close, [Fd]), + {ok,0} = rpc_call(Node, copy, [B,B]), + {ok, Fd2, B} = rpc_call(Node, path_open, [["."], B, [read]]), + ok = rpc_call(Node, close, [Fd2]) + end, true = test_server:stop_node(Node), ok. |