aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-07-10 10:45:13 +0200
committerErlang/OTP <[email protected]>2014-07-10 10:45:13 +0200
commitb376a4b8dd21a943be3226bb696a1622537edf86 (patch)
tree04546a16fe10c520c21aecd95caaa890723f75d8 /lib/kernel
parenta7176f9186ffd7eb2b26daca2264d425383cf6a7 (diff)
parentab5afc3d8cbd0211fef7c9c71edc2708f643f705 (diff)
downloadotp-b376a4b8dd21a943be3226bb696a1622537edf86.tar.gz
otp-b376a4b8dd21a943be3226bb696a1622537edf86.tar.bz2
otp-b376a4b8dd21a943be3226bb696a1622537edf86.zip
Merge branch 'nox/filelib-wildcard-broken-link' into maint-17
* nox/filelib-wildcard-broken-link: Update stdlib appup file Update runtime dependencies Update preloaded Add tests of filelib and symlinks Fix handling of broken symlinks in filelib Conflicts: erts/preloaded/ebin/erl_prim_loader.beam
Diffstat (limited to 'lib/kernel')
-rw-r--r--lib/kernel/src/erl_boot_server.erl6
-rw-r--r--lib/kernel/src/kernel.app.src2
-rw-r--r--lib/kernel/test/erl_prim_loader_SUITE.erl26
3 files changed, 31 insertions, 3 deletions
diff --git a/lib/kernel/src/erl_boot_server.erl b/lib/kernel/src/erl_boot_server.erl
index 9a49655a9f..ef09d86ca4 100644
--- a/lib/kernel/src/erl_boot_server.erl
+++ b/lib/kernel/src/erl_boot_server.erl
@@ -341,9 +341,13 @@ handle_command(S, PS, Msg) ->
send_file_result(S, list_dir, Res),
PS2;
{read_file_info,File} ->
- {Res, PS2} = erl_prim_loader:prim_read_file_info(PS, File),
+ {Res, PS2} = erl_prim_loader:prim_read_file_info(PS, File, true),
send_file_result(S, read_file_info, Res),
PS2;
+ {read_link_info,File} ->
+ {Res, PS2} = erl_prim_loader:prim_read_file_info(PS, File, false),
+ send_file_result(S, read_link_info, Res),
+ PS2;
get_cwd ->
{Res, PS2} = erl_prim_loader:prim_get_cwd(PS, []),
send_file_result(S, get_cwd, Res),
diff --git a/lib/kernel/src/kernel.app.src b/lib/kernel/src/kernel.app.src
index 5658c6b6cf..9f6c0f4624 100644
--- a/lib/kernel/src/kernel.app.src
+++ b/lib/kernel/src/kernel.app.src
@@ -115,6 +115,6 @@
{applications, []},
{env, [{error_logger, tty}]},
{mod, {kernel, []}},
- {runtime_dependencies, ["erts-6.0", "stdlib-2.0", "sasl-2.4"]}
+ {runtime_dependencies, ["erts-6.1.2", "stdlib-2.0", "sasl-2.4"]}
]
}.
diff --git a/lib/kernel/test/erl_prim_loader_SUITE.erl b/lib/kernel/test/erl_prim_loader_SUITE.erl
index b2ca3bdbc2..658c31c14d 100644
--- a/lib/kernel/test/erl_prim_loader_SUITE.erl
+++ b/lib/kernel/test/erl_prim_loader_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -328,6 +328,30 @@ file_requests(Config) when is_list(Config) ->
{ok,Info} = file:read_file_info(code:which(test_server)),
?line {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info,
[code:which(test_server)]),
+
+ PrivDir = ?config(priv_dir,Config),
+ Dir = filename:join(PrivDir,?MODULE_STRING++"_file_requests"),
+ ok = file:make_dir(Dir),
+ Alias = filename:join(Dir,"symlink"),
+ case file:make_symlink(code:which(test_server), Alias) of
+ {error, enotsup} ->
+ %% Links not supported on this platform
+ ok;
+ {error, eperm} ->
+ {win32,_} = os:type(),
+ %% Windows user not privileged to create symlinks"
+ ok;
+ ok ->
+ %% Reading file info for link should return file info for
+ %% link target
+ {ok,Info} = rpc:call(Node, erl_prim_loader, read_file_info,
+ [Alias]),
+ #file_info{type=regular} = Info,
+ {ok,#file_info{type=symlink}} =
+ rpc:call(Node, erl_prim_loader, read_link_info,
+ [Alias])
+ end,
+
{ok,Cwd} = file:get_cwd(),
?line {ok,Cwd} = rpc:call(Node, erl_prim_loader, get_cwd, []),
case file:get_cwd("C:") of