Skip to content

Commit 9bf0494

Browse files
committed
Merge branch 'master' of github.com:PolySat/libproc
2 parents 832f871 + fbece15 commit 9bf0494

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

Make.rules.Darwin

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
SO_EXT=dylib
2-
SO_CFLAGS=
2+
SO_CFLAGS= -D_XOPEN_SOURCE
33
SO_LDFLAGS=-dynamiclib -current_version $(MAJOR_VERS).$(MINOR_VERS)
44
CFLAG_WARNS=-Wno-format-truncation -Wno-deprecated-declarations

eventTimer.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ int ET_rtdebug_monotonic(struct EventTimer *arg, struct timeval *tv)
158158

159159
#ifdef __APPLE__
160160

161-
res = 0
162-
gettimeofday(now, NULL)
161+
res = 0;
162+
// WARNING: Not a monotonic clock, simply a stub for Apple devices.
163+
gettimeofday(&now, NULL);
163164

164165
#else
165166

plugin.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ static void configure_set(struct PluginSet *set)
142142
set->data = data;
143143
data->set = set;
144144
c = data->name_lc = strdup(set->prefix);
145-
while ((*c++ = tolower(*c)));
145+
146+
for(int i = 0; c[i]; i++){
147+
c[i] = tolower(c[i]);
148+
}
146149

147150
if (set->initial_paths) {
148151
paths = strdup(set->initial_paths);
@@ -215,7 +218,10 @@ static struct PluginList *find_plugin(struct PluginSet *set, const char *name,
215218
if (len >= sizeof(_name))
216219
c = name_lc = malloc(len + 1);
217220
strcpy(name_lc, name);
218-
while ((*c++ = tolower(*c)));
221+
222+
for(int i = 0; c[i]; i++){
223+
c[i] = tolower(c[i]);
224+
}
219225

220226
for (dirs = set->data->dirs; dirs && dirs->dir; dirs = dirs->next) {
221227
snprintf(path, sizeof(path), "%s/%s-%s" PL_PLUGIN_SUFFIX, dirs->dir->path,

zmqlite.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ static char ZMQ_HANDSHAKE_DATA[] = { 0x04, 0x1A, 0x05, 'R', 'E', 'A', 'D', 'Y',
3535
#define ZMQ_LONG_SIZE 0x2
3636
#define ZMQ_COMMAND 0x4
3737

38+
#ifndef __APPLE__
3839
#define htonll(x) ((1==htonl(1)) ? (x) : ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))
3940
#define ntohll(x) ((1==ntohl(1)) ? (x) : ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
40-
41+
#endif
4142

4243
struct ZMQLClient {
4344
int socket;
@@ -201,7 +202,7 @@ int zmql_accept_cb(int fd, char type, void *arg)
201202
return EVENT_KEEP;
202203
memset(client, 0, sizeof(*client));
203204

204-
client->socket = accept(fd, &client->addr, &len);
205+
client->socket = accept(fd, (struct sockaddr*) &client->addr, &len);
205206
if (client->socket == -1) {
206207
DBG_print(DBG_LEVEL_WARN, "Failed to accept zmql client.");
207208
free(client);

0 commit comments

Comments
 (0)