/*********************************************************
- * Copyright (C) 2004-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2019 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#include "err.h"
#define LOGLEVEL_MODULE poll
+#define LOGLEVEL_VARIADIC
#include "loglevel_user.h"
#define LOG_ENTRY(_l, _str, _e, _isWrite) \
do { \
if (_isWrite) { \
- LOG(_l, ("POLL: entry %p (wcb %p, data %p, flags %x, type %x)" _str, \
- (_e), (_e)->write.cb, (_e)->write.clientData, \
- (_e)->write.flags, (_e)->type)); \
+ LOG(_l, "POLL: entry %p (wcb %p, data %p, flags %x, type %x)" _str, \
+ (_e), (_e)->write.cb, (_e)->write.clientData, \
+ (_e)->write.flags, (_e)->type); \
} else { \
- LOG(_l, ("POLL: entry %p (rcb %p, data %p, flags %x, type %x)" _str, \
- (_e), (_e)->read.cb, (_e)->read.clientData, \
- (_e)->read.flags, (_e)->type)); \
+ LOG(_l, "POLL: entry %p (rcb %p, data %p, flags %x, type %x)" _str, \
+ (_e), (_e)->read.cb, (_e)->read.clientData, \
+ (_e)->read.flags, (_e)->type); \
} \
} while (0)
PollGtkEventCallbackWork(NULL, condition, entry, TRUE, &firedAll);
exit:
- LOG(4, ("POLL: entry %p %s\n", entry, entry && condition ?
- (firedAll ? "fired" : "not all fired") : "not ready to fire"));
+ LOG(4, "POLL: entry %p %s\n", entry, entry && condition ?
+ (firedAll ? "fired" : "not all fired") : "not ready to fire");
return firedAll;
}
/* Return TRUE to keep this function firing, FALSE to unregister. */
if (g_hash_table_size(poll->signaledTable) > 0) {
- LOG(5, ("POLL: not removing retry source\n"));
+ LOG(5, "POLL: not removing retry source\n");
ret = TRUE;
} else {
- LOG(5, ("POLL: no retry remains; removing timer source\n"));
+ LOG(5, "POLL: no retry remains; removing timer source\n");
poll->retrySource = 0;
ret = FALSE;
}
if (poll->signaledInUse) {
if (!g_slist_find(poll->newSignaled, key)) {
poll->newSignaled = g_slist_prepend(poll->newSignaled, key);
- LOG(4, ("POLL: added entry %p event 0x%x to signaled list\n",
- entry, entry->event));
+ LOG(4, "POLL: added entry %p event 0x%x to signaled list\n",
+ entry, entry->event);
}
} else {
g_hash_table_replace(poll->signaledTable, key, entry);
if (poll->retrySource == 0) {
poll->retrySource = g_timeout_add(0, PollGtkFireSignaledList, NULL);
}
- LOG(4, ("POLL: added entry %p event 0x%x to signaled hash table\n",
- entry, entry->event));
+ LOG(4, "POLL: added entry %p event 0x%x to signaled hash table\n",
+ entry, entry->event);
}
}
ret = send(entry->event, &c, 0, 0);
if (ret == SOCKET_ERROR) {
if (GetLastError() != WSAEWOULDBLOCK) {
- LOG(1, ("POLL error while doing zero-byte send: %u %s\n",
- GetLastError(), Err_ErrString()));
+ LOG(1, "POLL error while doing zero-byte send: %u %s\n",
+ GetLastError(), Err_ErrString());
}
return FALSE;
} else {
LOG_ENTRY(2, " to be removed\n", foundEntry, FALSE);
if (!g_hash_table_remove(poll->timerTable,
(gpointer)(intptr_t)foundEntry->gtkInputId)) {
- LOG(2, ("POLL: entry %p not found\n", foundEntry));
+ LOG(2, "POLL: entry %p not found\n", foundEntry);
}
}
}
PollGtkCallbackRemoveEntry(foundEntry, FALSE);
}
} else {
- LOG(1, ("POLL: no matching entry for cb %p, data %p, flags %x, type %x\n",
- f, clientData, flags, type));
+ LOG(1, "POLL: no matching entry for cb %p, data %p, flags %x, type %x\n",
+ f, clientData, flags, type);
}
PollGtkUnlock();