diff options
Diffstat (limited to 'erts/preloaded/src/prim_file.erl')
-rw-r--r-- | erts/preloaded/src/prim_file.erl | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 5c9cad3a2c..46ce3ab1a4 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -1493,19 +1493,15 @@ to_seconds({_,_} = Datetime, universal) -> to_seconds({_,_} = Datetime, local) -> erlang:universaltime_to_posixtime(erlang:localtime_to_universaltime(Datetime)). -%% TODO: Duplicate code! get_dtrace_utag() -> - case get(dtrace_utag) of - X when is_list(X) -> - X; - _ -> - "" + %% We cannot call dtrace:get_utag() because this is prim_file.erl. + %% We must reimplement it here. + case get('_dtrace_utag_@_@') of + undefined -> + <<>>; + X -> + X end. -%% TODO: Measure if it's worth checking (re:run()?) for NUL byte first? -enc_utag([0|Cs]) -> - enc_utag(Cs); -enc_utag([C|Cs]) -> - [C|enc_utag(Cs)]; -enc_utag([]) -> - [0]. +enc_utag(UTag) -> + [UTag, 0]. |