Skip to content

Commit

Permalink
Add yaws:hup/0 to allow Yaws reloads from another erlang module
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Faulet committed Jul 7, 2014
1 parent 6e2a971 commit 26badd6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/yaws.erl
Expand Up @@ -14,7 +14,7 @@
-include("yaws_debug.hrl").

-include_lib("kernel/include/file.hrl").
-export([start/0, stop/0, hup/1, restart/0, modules/0, load/0]).
-export([start/0, stop/0, hup/0, hup/1, restart/0, modules/0, load/0]).
-export([start_embedded/1, start_embedded/2, start_embedded/3, start_embedded/4,
add_server/2, create_gconf/2, create_sconf/2, setup_sconf/2]).

Expand Down Expand Up @@ -662,6 +662,9 @@ lkup(Key, List, Def) ->



hup() ->
dohup(undefined).

hup(Sock) ->
spawn(fun() ->
group_leader(whereis(user), self()),
Expand All @@ -681,7 +684,7 @@ dohup(Sock) ->
yaws_log:rotate(Res),
case Sock of
undefined ->
ok;
{yaws_hupped, Res};
_ ->
gen_tcp:send(Sock, io_lib:format("hupped: ~p~n", [Res])),
gen_tcp:close(Sock)
Expand Down

0 comments on commit 26badd6

Please sign in to comment.