Browse Source

Merge pull request #104 from seriyps/erlang_19_compat

Make it compatible with Erlang 19. Add travis
Sergey Prokhorov 8 years ago
parent
commit
2e94d18c76
2 changed files with 3 additions and 2 deletions
  1. 1 0
      .travis.yml
  2. 2 2
      src/epgsql_wire.erl

+ 1 - 0
.travis.yml

@@ -4,6 +4,7 @@ otp_release:
   - R16B03-1
   - R16B03-1
   - 17.4
   - 17.4
   - 18.2
   - 18.2
+  - 19.1
 before_script:
 before_script:
   - sudo apt-get update -qq
   - sudo apt-get update -qq
   - sudo apt-get install postgresql-9.4-postgis-2.1 postgresql-contrib-9.4
   - sudo apt-get install postgresql-9.4-postgis-2.1 postgresql-contrib-9.4

+ 2 - 2
src/epgsql_wire.erl

@@ -209,6 +209,6 @@ encode_list(L) ->
     <<(byte_size(Bin)):?int32, Bin/binary>>.
     <<(byte_size(Bin)):?int32, Bin/binary>>.
 
 
 encode_standby_status_update(ReceivedLSN, FlushedLSN, AppliedLSN) ->
 encode_standby_status_update(ReceivedLSN, FlushedLSN, AppliedLSN) ->
-    {MegaSecs, Secs, MicroSecs} = erlang:now(),
+    {MegaSecs, Secs, MicroSecs} = os:timestamp(),
     Timestamp = ((MegaSecs * 1000000 + Secs) * 1000000 + MicroSecs) - 946684800*1000000, %% microseconds since midnight on 2000-01-01
     Timestamp = ((MegaSecs * 1000000 + Secs) * 1000000 + MicroSecs) - 946684800*1000000, %% microseconds since midnight on 2000-01-01
-    <<$r:8, ReceivedLSN:?int64, FlushedLSN:?int64, AppliedLSN:?int64, Timestamp:?int64, 0:8>>.
+    <<$r:8, ReceivedLSN:?int64, FlushedLSN:?int64, AppliedLSN:?int64, Timestamp:?int64, 0:8>>.