Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit eb6aa7e

Browse files
prepare 2.1.1 release (#21)
1 parent 440ed03 commit eb6aa7e

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.circleci/config.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ workflows:
88
build_and_test_all:
99
jobs:
1010
- build-test-linux
11+
- build-test-linux-32bit
1112
- build-test-osx
1213
- build-test-windows
1314

@@ -32,6 +33,36 @@ jobs:
3233
cd build
3334
CTEST_OUTPUT_ON_FAILURE=1 make test
3435
36+
build-test-linux-32bit:
37+
docker:
38+
- image: i386/ubuntu:18.04
39+
- image: redis
40+
environment:
41+
CTEST_OUTPUT_ON_FAILURE: 1
42+
steps:
43+
- checkout
44+
- run:
45+
name: Install dependencies
46+
command: |
47+
apt-get update -y
48+
apt-get install -y \
49+
libcurl4-openssl-dev \
50+
libpcre3-dev \
51+
libhiredis-dev \
52+
build-essential \
53+
cmake
54+
- run:
55+
name: Build
56+
command: |
57+
mkdir build && cd build
58+
cmake -D REDIS_STORE=ON ..
59+
cmake --build .
60+
- run:
61+
name: Test
62+
command: |
63+
cd build
64+
CTEST_OUTPUT_ON_FAILURE=1 make test
65+
3566
build-test-osx:
3667
macos:
3768
xcode: "9.0"

src/utility.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <windows.h>
1717
#else
1818
#include <unistd.h>
19+
#include <errno.h>
1920
#endif
2021

2122
int
@@ -67,10 +68,20 @@ LDi_sleepMilliseconds(const unsigned long milliseconds)
6768
return true;
6869
#else
6970
int status;
71+
useconds_t usec;
7072

71-
if ((status = usleep(1000 * milliseconds)) != 0) {
73+
if (milliseconds >= 1000) {
74+
usec = 999999;
75+
76+
LD_LOG(LD_LOG_WARNING,
77+
"LDi_sleepMilliseconds capping usleep at 999999");
78+
} else {
79+
usec = milliseconds * 1000;
80+
}
81+
82+
if ((status = usleep(usec)) != 0) {
7283
LD_LOG_1(LD_LOG_CRITICAL, "usleep failed with: %s",
73-
strerror(status));
84+
strerror(errno));
7485

7586
LD_ASSERT(false);
7687

src/utility.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#define LD_UUID_SIZE 36
2929

30+
/* limited to 1 second */
3031
bool LDi_sleepMilliseconds(const unsigned long milliseconds);
3132
bool LDi_getMonotonicMilliseconds(double *const resultMilliseconds);
3233
bool LDi_getUnixMilliseconds(double *const resultMilliseconds);

0 commit comments

Comments
 (0)