Cluster Project branch, STABLE2, updated. cluster-2.03.04-24-g114dd2e
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".
The branch, STABLE2 has been updated
via 114dd2efb2e8219324a06948588f4e70f47b91d7 (commit)
via 2ec282bd0ae2c9c86655e48744c93226101b1e23 (commit)
from 1a500cfd7f8ed5e4e2b3beb02ef709d49bf925a6 (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 114dd2efb2e8219324a06948588f4e70f47b91d7
Author: Fabio M. Di Nitto <[email protected]> Date: Fri Jun 20 16:44:47 2008 +0200
[MISC] Fix previous cherry pick build failure in stable branch
commit 2ec282bd0ae2c9c86655e48744c93226101b1e23
Author: Fabio M. Di Nitto <[email protected]> Date: Wed May 7 09:54:12 2008 +0200
[MISC] Fix build errors with Fedora default build options
-----------------------------------------------------------------------
Summary of changes:
cman/qdisk/daemon_init.c | 13 +++++++++++-- cman/qdisk/scandisk.c | 20 +++++++++++++++++--- fence/agents/xvm/fence_xvm.c | 4 +++- fence/agents/xvm/fence_xvmd.c | 6 +++++- fence/agents/xvm/xml.c | 2 +- rgmanager/src/clulib/cman.c | 6 ++++-- rgmanager/src/clulib/daemon_init.c | 14 +++++++++++--- rgmanager/src/clulib/msg_cluster.c | 26 ++++++++++++++++++-------- rgmanager/src/clulib/msgtest.c | 3 ++- rgmanager/src/daemons/clurmtabd_lib.c | 2 +- rgmanager/src/daemons/main.c | 3 ++- 11 files changed, 75 insertions(+), 24 deletions(-)
cman/qdisk/daemon_init.c +11 -2
@@ -129,8 +129,13 @@ check_process_running(char *prog, pid_t * pid)if (fp ==NULL ) {/* error */ return 0 ; } -fscanf (fp,"%d\n" , &oldpid); + + ret =fscanf (fp,"%d\n" , &oldpid);fclose (fp); + +if ((ret ==EOF ) || (ret !=1 )) +return 0 ; +if (check_pid_valid (oldpid, cmd)) { *pid = oldpid;return 1 ;
@@ -213,7 +218,11 @@ daemon_init(char *prog)exit (1 ); } -daemon (0 ,0 ); +if (daemon (0 ,0 )) { +fprintf (stderr,"daemon_init: Unable to daemonize.\n" ); +exit (1 ); + } +update_pidfile (prog); }
cman/qdisk/scandisk.c +17 -3
@@ -466,8 +466,13 @@ static int sysfs_is_dev(char *path, int *maj, int *min)if (!lstat (newpath, &sb)) { f =fopen (newpath,"r" );if (f) { -fscanf (f,"%d:%d" , maj, min); +int err; + + err =fscanf (f,"%d:%d" , maj, min);fclose (f); +if ((err ==EOF ) || (err !=2 )) +return -1 ; +return 1 ; }else return -1 ;
@@ -494,8 +499,12 @@ static int sysfs_is_removable(char *path)if (!lstat (newpath, &sb)) { f =fopen (newpath,"r" );if (f) { -fscanf (f,"%d\n" , &i); +int err; + + err =fscanf (f,"%d\n" , &i);fclose (f); +if ((err ==EOF ) || (err !=1 )) + i =-1 ; } }return i;
@@ -586,9 +595,14 @@ static int sysfs_is_disk(char *path) found: f =fopen (newpath,"r" );if (f) { -fscanf (f,"%d\n" , &i); +int err; + + err =fscanf (f,"%d\n" , &i);fclose (f); +if ((err ==EOF ) || (err !=1 )) +return 0 ; +switch (i) {case 0x0 :/* scsi type_disk */ case 0xe :/* found on ide disks from old kernels.. */
fence/agents/xvm/fence_xvm.c +3 -1
@@ -104,7 +104,9 @@ tcp_exchange(int fd, fence_auth_type_t auth, void *key,return -1 ;/* Read return code */ -read (fd, &ret,1 ); +if (read (fd, &ret,1 ) <0 ) +return -1 ; +close (fd);if (ret ==0 )printf ("Remote: Operation was successful\n" );
fence/agents/xvm/fence_xvmd.c +5 -1
@@ -742,7 +742,11 @@ main(int argc, char **argv)/* XXX need to wait for child to successfully start before exiting... */ if (!(args.flags &F_FOREGROUND )) -daemon (0 ,0 ); +if (daemon (0 ,0 )) { +printf ("Could not daemonize\n" ); +return 1 ; + } +if (virInitialize () !=0 ) {printf ("Could not initialize libvirt\n" );
fence/agents/xvm/xml.c +1 -1
@@ -184,7 +184,7 @@ xtree_writefile(const char *filename, xmlDocPtr xtree)memset (&flock,0 ,sizeof (flock)); flock.l_type =F_WRLCK ; - fd =open (filename,O_WRONLY |O_CREAT |O_SYNC ); + fd =open (filename,O_WRONLY |O_CREAT |O_SYNC ,S_IRUSR |S_IWUSR );if (fd ==-1 ) { n = errno;close (tmpfd);
rgmanager/src/clulib/cman.c +4 -2
@@ -68,7 +68,8 @@ cman_lock(int block, int preempt)/* Try to wake up the holder! */ if (preempt) -write (_wakeup_pipe[1 ],"!" ,1 ); +if (write (_wakeup_pipe[1 ],"!" ,1 ) <0 ) + goto out_unlock;/* Blocking call; do the cond-thing */ pthread_cond_wait (&_chandle_cond, &_chandle_lock);
@@ -165,7 +166,8 @@ cman_unlock(cman_handle_t ch)/* Empty wakeup pipe if we took it with the preempt flag */ if (_chandle_preempt) -read (_wakeup_pipe[0 ], &c,1 ); +if (read (_wakeup_pipe[0 ], &c,1 ) <0 ) + goto out_unlock; _chandle_preempt =0 ; _chandle_holder =0 ;
rgmanager/src/clulib/daemon_init.c +11 -3
@@ -131,8 +131,11 @@ check_process_running(char *prog, pid_t * pid)if (fp ==NULL ) {/* error */ return 0 ; } -fscanf (fp,"%d\n" , &oldpid); + ret =fscanf (fp,"%d\n" , &oldpid);fclose (fp); +if ((ret ==EOF ) || (ret !=1 )) +return 0 ; +if (check_pid_valid (oldpid, cmd)) { *pid = oldpid;return 1 ;
@@ -209,9 +212,14 @@ daemon_init(char *prog)exit (1 ); } -daemon (0 ,0 ); +if (daemon (0 ,0 )) { +fprintf (stderr,"daemon_init: Unable to daemonize.\n" ); +exit (1 ); + }update_pidfile (prog); -nice (-1 ); +if (nice (-1 ) <0 ) +fprintf (stderr,"daemon_init: Unable to renice.\n" ); +//mlockall(MCL_CURRENT | MCL_FUTURE); }
rgmanager/src/clulib/msg_cluster.c +18 -8
@@ -318,7 +318,12 @@ cluster_msg_fd_set(msgctx_t *ctx, fd_set *fds, int *max)by the caller because the caller is switching to select() semantics. (as opposed to msg_wait() ) */ list_do(&ctx->u.cluster_info.queue, n) { -write (ctx->u.cluster_info.select_pipe[1 ],"" ,1 ); +if (write (ctx->u.cluster_info.select_pipe[1 ],"" ,1 ) <0 ) { + e = errno; +pthread_mutex_unlock (&ctx->u.cluster_info.mutex); + errno = e; +return -1 ; + } }while (!list_done (&ctx->u.cluster_info.queue, n)); }
@@ -411,8 +416,10 @@ _cluster_msg_receive(msgctx_t *ctx, void **msg, size_t *len)if (ctx->u.cluster_info.select_pipe[0 ] >=0 ) {//printf("%s read\n", __FUNCTION__); -read (ctx->u.cluster_info.select_pipe[0 ], - &foo,1 ); +if (read (ctx->u.cluster_info.select_pipe[0 ], &foo,1 ) <0 ) { +pthread_mutex_unlock (&ctx->u.cluster_info.mutex); +return -1 ; + } }pthread_mutex_unlock (&ctx->u.cluster_info.mutex);
@@ -516,8 +523,10 @@ cluster_msg_receive(msgctx_t *ctx, void *msg, size_t maxlen, int timeout)if (ctx->u.cluster_info.select_pipe[0 ] >=0 ) {//printf("%s read\n", __FUNCTION__); -read (ctx->u.cluster_info.select_pipe[0 ], - &foo,1 ); +if (read (ctx->u.cluster_info.select_pipe[0 ], &foo,1 ) <0 ) { +pthread_mutex_unlock (&ctx->u.cluster_info.mutex); +return -1 ; + } }pthread_mutex_unlock (&ctx->u.cluster_info.mutex);
@@ -844,6 +853,7 @@ cluster_msg_accept(msgctx_t *listenctx, msgctx_t *acceptctx)cluster_msg_hdr_t *m;msg_q_t *n;char foo; +int err =0 ;if (!listenctx || !acceptctx)return -1 ;
@@ -906,8 +916,8 @@ cluster_msg_accept(msgctx_t *listenctx, msgctx_t *acceptctx)if (listenctx->u.cluster_info.select_pipe[0 ] >=0 ) {//printf("%s read\n", __FUNCTION__); -read (listenctx->u.cluster_info.select_pipe[0 ], - &foo,1 ); +if (read (listenctx->u.cluster_info.select_pipe[0 ], &foo,1 ) <0 ) + err =-1 ; }free (m);
@@ -915,7 +925,7 @@ cluster_msg_accept(msgctx_t *listenctx, msgctx_t *acceptctx)/* Let the new context go. */ pthread_mutex_unlock (&acceptctx->u.cluster_info.mutex); -return 0 ; +return err;/* notreached */ case M_DATA :
rgmanager/src/clulib/msgtest.c +2 -1
@@ -227,7 +227,8 @@ main(int argc, char **argv)select (max+1 , &rfds,NULL ,NULL ,NULL );if (FD_ISSET (STDIN_FILENO , &rfds)) { -fgets (recvbuf,128 , stdin); +if (!fgets (recvbuf,128 , stdin)) +break ;if (recvbuf[0 ] =='q' || recvbuf[0 ] =='Q' )break ; if (msg_send(cluster_ctx, recvbuf,
rgmanager/src/daemons/clurmtabd_lib.c +1 -1
@@ -551,7 +551,7 @@ rmtab_read(rmtab_node **head, char *filename)if (!fp) {/* It's ok if it's not there. */ if (errno ==ENOENT ) { -close (open (filename,O_WRONLY |O_SYNC |O_CREAT )); +close (open (filename,O_WRONLY |O_SYNC |O_CREAT ,S_IRUSR |S_IWUSR ));return 0 ; }perror ("fopen" );
rgmanager/src/daemons/main.c +2 -1
@@ -55,10 +55,11 @@ void segfault(int __attribute__ ((unused)) sig) {char ow[64 ]; +int err;// dumb error checking... will be replaced by logsys snprintf (ow,sizeof (ow)-1 ,"PID %d Thread %d: SIGSEGV\n" ,getpid (),gettid ()); -write (2 , ow,strlen (ow)); + err =write (2 , ow,strlen (ow));while (1 )sleep (60 ); }
hooks/post-receive
--
Cluster Project