This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cluster Project branch, master, updated. cluster-2.99.00-23-gdb35b82


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=db35b82b2d5dd4091f9c368d8f7d8b36ad965f78

The branch, master has been updated
       via  db35b82b2d5dd4091f9c368d8f7d8b36ad965f78 (commit)
      from  1edb73bd098500d459c16797da2377a59f1ef180 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit db35b82b2d5dd4091f9c368d8f7d8b36ad965f78
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
Date:   Wed May 7 11:03:45 2008 +0200

    [MISC] Fix more build errors with Fedora default build options
    
    NOTE: some bits are absolutely not required but we still
    add them to shut up the warnings.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 ccs/daemon/ccsd.c             |    3 ++-
 cman/cman_tool/join.c         |    7 ++++---
 cman/cman_tool/main.c         |    9 ++++++---
 cman/daemon/ais.c             |    6 ++++--
 cman/daemon/cman-preconfig.c  |    8 --------
 cman/daemon/cman.h            |    2 +-
 dlm/tool/main.c               |    5 ++++-
 group/daemon/cman.c           |    4 ++--
 group/daemon/cpg.c            |    2 +-
 group/daemon/main.c           |   15 ++++++++++++---
 group/dlm_controld/deadlock.c |   10 ++++++++--
 group/dlm_controld/main.c     |    5 ++++-
 group/dlm_controld/plock.c    |    4 +++-
 group/gfs_controld/main.c     |    5 ++++-
 group/tool/main.c             |    8 ++++++--
 15 files changed, 61 insertions(+), 32 deletions(-)

diff --git a/ccs/daemon/ccsd.c b/ccs/daemon/ccsd.c
index d9cc152..539ca58 100644
--- a/ccs/daemon/ccsd.c
+++ b/ccs/daemon/ccsd.c
@@ -755,7 +755,8 @@ static void daemonize(void){
     }
     ppid = getppid();
     setsid();
-    chdir("/");
+    if(chdir("/") < 0)
+	goto fail;
     umask(0);
 
     close(0); close(1); close(2);
diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c
index 0774c24..e07c063 100644
--- a/cman/cman_tool/join.c
+++ b/cman/cman_tool/join.c
@@ -52,7 +52,7 @@ static void be_daemon(int close_stderr)
 
 int join(commandline_t *comline)
 {
-	int i;
+	int i, err;
 	int envptr = 0;
 	int argvptr = 0;
 	char scratch[1024];
@@ -119,7 +119,8 @@ int join(commandline_t *comline)
 	}
 
 	/* Create a pipe to monitor cman startup progress */
-	pipe(p);
+	if(pipe(p) < 0)
+		die("unable to create pipe: %s", strerror(errno));
 	fcntl(p[1], F_SETFD, 0); /* Don't close on exec */
 	snprintf(scratch, sizeof(scratch), "CMAN_PIPE=%d", p[1]);
 	envp[envptr++] = strdup(scratch);
@@ -155,7 +156,7 @@ int join(commandline_t *comline)
 
 		/* exec failed - tell the parent process */
 		sprintf(scratch, "execve of " AISEXECBIN " failed: %s", strerror(errno));
-		write(p[1], scratch, strlen(scratch));
+		err = write(p[1], scratch, strlen(scratch));
 		exit(1);
 		break;
 
diff --git a/cman/cman_tool/main.c b/cman/cman_tool/main.c
index f79897d..19f8438 100644
--- a/cman/cman_tool/main.c
+++ b/cman/cman_tool/main.c
@@ -526,9 +526,9 @@ static void show_nodes(commandline_t *comline)
 	cman_finish(h);
 }
 
-static void show_services(void)
+static int show_services(void)
 {
-	system("group_tool ls");
+	return system("group_tool ls");
 }
 
 
@@ -1052,7 +1052,10 @@ int main(int argc, char *argv[])
 		break;
 
 	case OP_SERVICES:
-		show_services();
+		if (show_services() < 0) {
+			fprintf(stderr, "Unable to invoke group_tool\n");
+			exit(EXIT_FAILURE);
+		}
 		break;
 
 	case OP_DEBUG:
diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c
index 69a2718..e37ec43 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -336,8 +336,10 @@ static void cman_confchg_fn(enum totem_configuration_type configuration_type,
 
 /* Write an error message down the CMAN startup pipe so
    that cman_tool can display it */
-void write_cman_pipe(char *message)
+int write_cman_pipe(char *message)
 {
 	if (startup_pipe)
-		write(startup_pipe, message, strlen(message)+1);
+		return write(startup_pipe, message, strlen(message)+1);
+
+	return 0;
 }
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index b03d995..7ea925c 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -940,11 +940,3 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, char **error_strin
 
 	return ret;
 }
-
-/* Write an error message down the CMAN startup pipe so
-   that cman_tool can display it */
-void write_cman_pipe(char *message)
-{
-	if (startup_pipe)
-		write(startup_pipe, message, strlen(message)+1);
-}
diff --git a/cman/daemon/cman.h b/cman/daemon/cman.h
index 09a4393..0fbea46 100644
--- a/cman/daemon/cman.h
+++ b/cman/daemon/cman.h
@@ -11,5 +11,5 @@
 ******************************************************************************/
 
 /* General cman bits */
-extern void write_cman_pipe(char *message);
+extern int write_cman_pipe(char *message);
 extern void close_cman_pipe(void);
diff --git a/dlm/tool/main.c b/dlm/tool/main.c
index 3c00ec7..13a7a23 100644
--- a/dlm/tool/main.c
+++ b/dlm/tool/main.c
@@ -366,7 +366,10 @@ void do_lockdump(char *name)
 	}
 
 	/* skip the header on the first line */
-	fgets(line, LOCK_LINE_MAX, file);
+	if(!fgets(line, LOCK_LINE_MAX, file)) {
+		fprintf(stderr, "can't read %s: %s\n", path, strerror(errno));
+		return;
+	}
 
 	while (fgets(line, LOCK_LINE_MAX, file)) {
 		rv = sscanf(line, "%x %d %x %u %llu %x %x %hhd %hhd %hhd %u %d %d",
diff --git a/group/daemon/cman.c b/group/daemon/cman.c
index 1b44269..272b155 100644
--- a/group/daemon/cman.c
+++ b/group/daemon/cman.c
@@ -138,13 +138,13 @@ int setup_cman(void)
 
 	ch = cman_init(NULL);
 	if (!ch) {
-		log_print("cman_init error %d %d", (int) ch, errno);
+		log_print("cman_init error %p %d", ch, errno);
 		return -ENOTCONN;
 	}
 
 	ch_admin = cman_admin_init(NULL);
 	if (!ch_admin) {
-		log_print("cman_admin_init error %d %d", (int) ch_admin, errno);
+		log_print("cman_admin_init error %p %d", ch_admin, errno);
 		rv = -ENOTCONN;
 		goto fail1;
 	}
diff --git a/group/daemon/cpg.c b/group/daemon/cpg.c
index 3ac42f9..aa9d9db 100644
--- a/group/daemon/cpg.c
+++ b/group/daemon/cpg.c
@@ -478,7 +478,7 @@ cpg_callbacks_t callbacks = {
 
 void process_cpg(int ci)
 {
-	group_t *g;
+	group_t *g = NULL;
 	cpg_error_t error;
 	cpg_handle_t handle;
 	int found = 0;
diff --git a/group/daemon/main.c b/group/daemon/main.c
index af7d5bd..4af78a2 100644
--- a/group/daemon/main.c
+++ b/group/daemon/main.c
@@ -837,7 +837,10 @@ void daemonize(void)
 	if (pid)
 		exit(EXIT_SUCCESS);
 	setsid();
-	chdir("/");
+	if(chdir("/") < 0) {
+		perror("main: unable to chdir");
+		exit(EXIT_FAILURE);
+	}
 	umask(0);
 	close(0);
 	close(1);
@@ -951,8 +954,14 @@ void bail_with_log(int sig)
 		memset(now_ascii, 0, sizeof(now_ascii));
 		time(&now);
 		sprintf(now_ascii, "%ld", now);
-		write(fd, now_ascii, strlen(now_ascii));
-		write(fd, " groupd segfault log follows:\n", 30);
+		if (write(fd, now_ascii, strlen(now_ascii)) < 0) {
+			perror("Unable to write");
+			exit(1);
+		}
+		if (write(fd, " groupd segfault log follows:\n", 30) < 0) {
+			perror("Unable to write");
+			exit(1);
+		}
 		close(fd);
 	} else
 		perror(LOG_FILE);
diff --git a/group/dlm_controld/deadlock.c b/group/dlm_controld/deadlock.c
index e9f7986..36a4e5f 100644
--- a/group/dlm_controld/deadlock.c
+++ b/group/dlm_controld/deadlock.c
@@ -367,7 +367,10 @@ static int read_debugfs_master(struct lockspace *ls)
 		return -1;
 
 	/* skip the header on the first line */
-	fgets(line, LOCK_LINE_MAX, file);
+	if(!fgets(line, LOCK_LINE_MAX, file)) {
+		log_error("Unable to read %s: %d", path, errno);
+		goto out;
+	}
 
 	while (fgets(line, LOCK_LINE_MAX, file)) {
 		memset(&lock, 0, sizeof(struct pack_lock));
@@ -435,7 +438,10 @@ static int read_debugfs_locks(struct lockspace *ls)
 		return -1;
 
 	/* skip the header on the first line */
-	fgets(line, LOCK_LINE_MAX, file);
+	if(!fgets(line, LOCK_LINE_MAX, file)) {
+		log_error("Unable to read %s: %d", path, errno);
+		goto out;
+	}
 
 	while (fgets(line, LOCK_LINE_MAX, file)) {
 		memset(&lock, 0, sizeof(struct pack_lock));
diff --git a/group/dlm_controld/main.c b/group/dlm_controld/main.c
index 46d3fe8..ca4d3c0 100644
--- a/group/dlm_controld/main.c
+++ b/group/dlm_controld/main.c
@@ -995,7 +995,10 @@ static void daemonize(void)
 	if (pid)
 		exit(EXIT_SUCCESS);
 	setsid();
-	chdir("/");
+	if(chdir("/") < 0) {
+		perror("main: unable to chdir");
+		exit(EXIT_FAILURE);
+	}
 	umask(0);
 	close(0);
 	close(1);
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 033b7b7..28818c7 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1569,6 +1569,8 @@ void process_plocks(int ci)
 		return;
 	}
 
+	gettimeofday(&now, NULL);
+
 	memset(&info, 0, sizeof(info));
 
 	rv = do_read(control_fd, &info, sizeof(info));
@@ -1645,7 +1647,7 @@ void process_plocks(int ci)
 
  fail:
 	info.rv = rv;
-	write(control_fd, &info, sizeof(info));
+	rv = write(control_fd, &info, sizeof(info));
 }
 
 void process_saved_plocks(struct lockspace *ls)
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index b2edc32..14c7f14 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -791,7 +791,10 @@ void daemonize(void)
 	if (pid)
 		exit(EXIT_SUCCESS);
 	setsid();
-	chdir("/");
+	if(chdir("/") < 0) {
+		perror("main: unable to chdir");
+		exit(EXIT_FAILURE);
+	}
 	umask(0);
 	close(0);
 	close(1);
diff --git a/group/tool/main.c b/group/tool/main.c
index f1915ad..3a0d7d4 100644
--- a/group/tool/main.c
+++ b/group/tool/main.c
@@ -427,7 +427,7 @@ int do_plock_dump(int argc, char **argv, int fd)
 
 	rv = do_write(fd, outbuf, sizeof(outbuf));
 	if (rv < 0) {
-		printf("dump write error %d errno %d\n", rv, errno);;
+		printf("dump write error %d errno %d\n", rv, errno);
 		return -1;
 	}
 
@@ -436,7 +436,11 @@ int do_plock_dump(int argc, char **argv, int fd)
 		rv = read(fd, inbuf, sizeof(inbuf));
 		if (rv <= 0)
 			break;
-		write(STDOUT_FILENO, inbuf, rv);
+		rv = write(STDOUT_FILENO, inbuf, rv);
+		if (rv < 0) {
+			printf("dump write error %d errno %d\n", rv, errno);
+			return  -1;
+		}
 	}
 
 	close(fd);


hooks/post-receive
--
Cluster Project


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]