From: fabbione@sourceware.org <fabbione@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/ccs/ccs_tool update.c
Date: 3 May 2007 09:25:57 -0000 [thread overview]
Message-ID: <20070503092557.6309.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: fabbione at sourceware.org 2007-05-03 09:25:57
Modified files:
ccs/ccs_tool : update.c
Log message:
Remove dead code
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&r1=1.11&r2=1.12
--- cluster/ccs/ccs_tool/update.c 2007/05/03 09:06:39 1.11
+++ cluster/ccs/ccs_tool/update.c 2007/05/03 09:25:57 1.12
@@ -35,16 +35,10 @@
static member_list_t *get_member_list(cman_handle_t handle);
static void free_member_list(member_list_t *list);
-static char *member_id_to_name(member_list_t *list, int node);
-static int member_name_to_id(member_list_t *list, char *name);
-static int member_addr_to_id(member_list_t *list, struct sockaddr *addr);
-static int member_online_node(member_list_t *list, int node);
-static int member_online_name(member_list_t *list, char *name);
static int select_retry(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *xfds,
struct timeval *timeout);
-static ssize_t write_retry(int fd, void *buf, int count, struct timeval *timeout);
static ssize_t read_retry(int fd, void *buf, int count, struct timeval *timeout);
static int ccs_open(cman_node_t node, uint16_t baseport, int timeout);
@@ -447,78 +441,6 @@
}
-static char *member_id_to_name(member_list_t *list, int node)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (list->nodes[i].cn_nodeid == node) {
- return list->nodes[i].cn_name;
- }
- }
-
- return NULL;
-}
-
-
-static int member_name_to_id(member_list_t *list, char *name)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (!strcasecmp(list->nodes[i].cn_name, name)) {
- return list->nodes[i].cn_nodeid;
- }
- }
-
- return 0;
-}
-
-
-static int member_addr_to_id(member_list_t *list, struct sockaddr *addr)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (memcmp(&list->nodes[i].cn_address.cna_address, addr,
- sizeof(struct sockaddr))) {
-
- return list->nodes[i].cn_nodeid;
- }
- }
-
- return -1;
-}
-
-
-static int member_online_node(member_list_t *list, int node)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (list->nodes[i].cn_nodeid == node) {
- return list->nodes[i].cn_member;
- }
- }
-
- return 0;
-}
-
-
-static int member_online_name(member_list_t *list, char *name)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (!strcasecmp(list->nodes[i].cn_name, name)) {
- return list->nodes[i].cn_member;
- }
- }
-
- return 0;
-}
-
-
static int select_retry(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *xfds,
struct timeval *timeout)
{
@@ -535,68 +457,6 @@
}
-static ssize_t write_retry(int fd, void *buf, int count, struct timeval *timeout)
-{
- int n, total = 0, remain = count, rv = 0;
- fd_set wfds, xfds;
-
- while (total < count)
- {
- /* Create the write FD set of 1... */
- FD_ZERO(&wfds);
- FD_SET(fd, &wfds);
- FD_ZERO(&xfds);
- FD_SET(fd, &xfds);
-
- /* wait for the fd to be available for writing */
- rv = select_retry(fd + 1, NULL, &wfds, &xfds, timeout);
- if (rv == -1) {
- return -1;
- }
- else if (rv == 0) {
- errno = ETIMEDOUT;
- return -1;
- }
-
- if (FD_ISSET(fd, &xfds)) {
- errno = EPIPE;
- return -1;
- }
-
- /*
- * Attempt to write to fd
- */
- n = write(fd, buf + (off_t) total, remain);
-
- /*
- * When we know our fd was select()ed and we receive 0 bytes
- * when we write, the fd was closed.
- */
- if ((n == 0) && (rv == 1)) {
- errno = EPIPE;
- return -1;
- }
-
- if (n == -1) {
- if ((errno == EAGAIN) || (errno == EINTR)) {
- /*
- * Not ready?
- */
- continue;
- }
-
- /* Other errors: EIO, EINVAL, etc */
- return -1;
- }
-
- total += n;
- remain -= n;
- }
-
- return total;
-}
-
-
static ssize_t read_retry(int fd, void *buf, int count, struct timeval *timeout)
{
int n, total = 0, remain = count, rv = 0;
next reply other threads:[~2007-05-03 9:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 9:25 fabbione [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-06-19 18:08 [Cluster-devel] cluster/ccs/ccs_tool update.c lhh
2007-06-19 15:51 lhh
2007-01-26 22:14 lhh
2007-01-26 22:13 lhh
2006-11-30 15:57 pcaulfield
2006-11-28 11:23 pcaulfield
2006-11-28 11:20 pcaulfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070503092557.6309.qmail@sourceware.org \
--to=fabbione@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.