aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Karlsson <[email protected]>2013-11-08 14:00:36 +0100
committerLukas Larsson <[email protected]>2014-02-24 15:16:01 +0100
commita0766a4efeefe0ac035d2be04816274aee5751f3 (patch)
tree22de6927c4a1bdb778cbd764fea8f400ded170b8
parent5352e800edf7e59d352a8d2dc7a7bee7ba916e1b (diff)
downloadotp-a0766a4efeefe0ac035d2be04816274aee5751f3.tar.gz
otp-a0766a4efeefe0ac035d2be04816274aee5751f3.tar.bz2
otp-a0766a4efeefe0ac035d2be04816274aee5751f3.zip
ose: Bugfixes to filesystem related issues.
-rw-r--r--erts/emulator/drivers/ose/ose_efile.c6
-rw-r--r--lib/kernel/test/file_SUITE.erl39
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl5
3 files changed, 36 insertions, 14 deletions
diff --git a/erts/emulator/drivers/ose/ose_efile.c b/erts/emulator/drivers/ose/ose_efile.c
index 897d654e89..9980b07817 100644
--- a/erts/emulator/drivers/ose/ose_efile.c
+++ b/erts/emulator/drivers/ose/ose_efile.c
@@ -258,7 +258,11 @@ efile_mkdir(Efile_error* errInfo, /* Where to return error codes. */
#ifdef NO_MKDIR_MODE
return check_error(mkdir(name), errInfo);
#else
- return check_error(mkdir(name, DIR_MODE), errInfo);
+ int res = mkdir(name, DIR_MODE);
+ if (res < 0 && errno == EINVAL) {
+ errno = ENOENT;
+ }
+ return check_error(res, errInfo);
#endif
}
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index c75639ae7e..15b7016f7d 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -161,7 +161,13 @@ init_per_suite(Config) when is_list(Config) ->
ok ->
[{sasl,started}]
end,
- ok = application:start(os_mon),
+ ok = case os:type() of
+ {ose,_} ->
+ ok;
+ _ ->
+ application:start(os_mon)
+ end,
+
case os:type() of
{win32, _} ->
Priv = ?config(priv_dir, Config),
@@ -185,7 +191,13 @@ end_per_suite(Config) when is_list(Config) ->
_ ->
ok
end,
- application:stop(os_mon),
+
+ case os:type() of
+ {ose,_} ->
+ ok;
+ _ ->
+ application:stop(os_mon)
+ end,
case proplists:get_value(sasl, Config) of
started ->
application:stop(sasl);
@@ -525,11 +537,11 @@ cur_dir_1(Config) when is_list(Config) ->
?line Dog = test_server:timetrap(test_server:seconds(5)),
?line case os:type() of
- {unix, _} ->
- ?line {error, enotsup} = ?FILE_MODULE:get_cwd("d:");
- {win32, _} ->
- win_cur_dir_1(Config)
- end,
+ {win32, _} ->
+ win_cur_dir_1(Config);
+ _ ->
+ ?line {error, enotsup} = ?FILE_MODULE:get_cwd("d:")
+ end,
?line [] = flush(),
?line test_server:timetrap_cancel(Dog),
ok.
@@ -712,7 +724,10 @@ open1(Config) when is_list(Config) ->
?line io:format(Fd1,Str,[]),
?line {ok,0} = ?FILE_MODULE:position(Fd1,bof),
?line Str = io:get_line(Fd1,''),
- ?line Str = io:get_line(Fd2,''),
+ ?line case io:get_line(Fd2,'') of
+ Str -> Str;
+ eof -> Str
+ end,
?line ok = ?FILE_MODULE:close(Fd2),
?line {ok,0} = ?FILE_MODULE:position(Fd1,bof),
?line ok = ?FILE_MODULE:truncate(Fd1),
@@ -2171,13 +2186,13 @@ e_make_dir(Config) when is_list(Config) ->
%% No permission (on Unix only).
case os:type() of
- {unix, _} ->
+ {win32, _} ->
+ ok;
+ _ ->
?FILE_MODULE:write_file_info(Base, #file_info {mode=0}),
{error, eacces} = ?FILE_MODULE:make_dir(filename:join(Base, "xxxx")),
?FILE_MODULE:write_file_info(
- Base, #file_info {mode=8#600});
- {win32, _} ->
- ok
+ Base, #file_info {mode=8#600})
end,
test_server:timetrap_cancel(Dog),
ok.
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index ccf325a493..84618a881e 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -453,7 +453,10 @@ open1(Config) when is_list(Config) ->
?line ?PRIM_FILE:write(Fd1,Str),
?line {ok,0} = ?PRIM_FILE:position(Fd1,bof),
?line {ok, Str} = ?PRIM_FILE:read(Fd1,Length),
- ?line {ok, Str} = ?PRIM_FILE:read(Fd2,Length),
+ ?line case ?PRIM_FILE:read(Fd2,Length) of
+ Str -> Str;
+ eof -> Str
+ end,
?line ok = ?PRIM_FILE:close(Fd2),
?line {ok,0} = ?PRIM_FILE:position(Fd1,bof),
?line ok = ?PRIM_FILE:truncate(Fd1),