Permalink
Browse files

rebar: use file:sendfile/5 if erts version > R15B

  • Loading branch information...
1 parent 2150708 commit ddfa257773b86f6dfd886edac7b9d17922b02bbb @vinoski vinoski committed Apr 1, 2012
Showing with 6 additions and 6 deletions.
  1. +5 −5 rebar.config
  2. +1 −1 src/yaws_sendfile.erl
View
@@ -3,21 +3,21 @@
{plugins, [rebar_reltool_link]}.
{sub_dirs, ["rel"]}.
-{erl_opts, [%% OTP R11 - R15A -> yaws_sendfile_drv or compat_send
+{erl_opts, [%% OTP R11 - R15B -> yaws_sendfile_drv or compat_send
{platform_define,
- "R1([1-4]|5A).*(linux|freebsd|darwin)", 'HAVE_YAWS_SENDFILE'},
- {platform_define, "R1([1-4]|5A).*", 'NO_FILE_SENDFILE'},
+ "R1([1-4]|5[AB]-).*(linux|freebsd|darwin)", 'HAVE_YAWS_SENDFILE'},
+ {platform_define, "R1([1-4]|5[AB]-)", 'NO_FILE_SENDFILE'},
no_debug_info,
{src_dirs, ["src", "examples/src"]},
warnings_as_errors]}.
{port_envs, [{"CFLAGS", "$CFLAGS -g -O3 -Wall -I/usr/include/security"},
- {"R1([1-4]|5A).*(linux|freebsd|darwin)",
+ {"R1([1-4]|5[AB]-).*(linux|freebsd|darwin)",
"DRV_CFLAGS", "$DRV_CFLAGS -DHAVE_YAWS_SENDFILE"}]}.
{port_specs, [{"priv/lib/epam.so", ["c_src/epam.c"]},
{"priv/lib/setuid_drv.so", ["c_src/setuid_drv.c"]},
- {"R1([1-4]|5A).*(linux|freebsd|darwin)",
+ {"R1([1-4]|5[AB]-).*(linux|freebsd|darwin)",
"priv/lib/yaws_sendfile_drv.so",
["c_src/yaws_sendfile_drv.c", "c_src/hashtable.c"]}]}.
View
@@ -46,7 +46,7 @@ bytes_to_transfer(Filename, Offset, Count) ->
{error, badarg}
end.
--ifdef(HAVE_FILE_SENDFILE). %% OTP >= R15B; use file:sendfile/5
+-ifdef(HAVE_FILE_SENDFILE). %% OTP > R15B; use file:sendfile/5
enabled() ->
true.

0 comments on commit ddfa257

Please sign in to comment.