/*
- * Copyright (C) 2005-2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** The stat client's file descriptor. */
int fd;
/** Bitmask of those status items the client is interested in. */
- long unsigned item_mask;
+ uint64_t item_mask;
/** Its entry in the list of stat clients. */
struct list_head node;
};
* \return Positive value on success, or -E_TOO_MANY_CLIENTS if
* the number of connected clients exceeds #MAX_STAT_CLIENTS.
*/
-int stat_client_add(int fd, long unsigned mask)
+int stat_client_add(int fd, uint64_t mask)
{
struct stat_client *new_client;
{
struct stat_client *sc, *tmp;
size_t len = strlen(msg);
+ const uint64_t one = 1;
if (!initialized || !len)
return;
list_for_each_entry_safe(sc, tmp, &client_list, node) {
int fd = sc->fd, ret;
- if (!((1 << itemnum) & sc->item_mask))
+ if (!((one << itemnum) & sc->item_mask))
continue;
if (write_ok(fd) > 0) {
ret = write(fd, msg, len);
- PARA_DEBUG_LOG("dumped %s to fd %d, ret = %d\n", msg, fd, ret);
+ // PARA_DEBUG_LOG("dumped %s to fd %d, ret = %d\n", msg, fd, ret);
if (ret == len)
continue;
}
free(sc);
dump_stat_client_list();
}
- PARA_DEBUG_LOG("%d client(s)\n", num_clients);
+// if (num_clients)
+// PARA_DEBUG_LOG("%d client(s)\n", num_clients);
}
/**