cluster/dlm/lib libdlm.c
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: pcaulfield at sourceware.org 2007-01-31 11:16:05
Modified files:
dlm/lib : libdlm.c
Log message:
Read the LVB every time, rather than not at all.
dlm/lib/libdlm.c +9 -5
@@ -406,14 +406,14 @@static int do_dlm_dispatch (int fd) { -struct dlm_lock_result resultbuf; -struct dlm_lock_result *result = &resultbuf; +char resultbuf[sizeof (struct dlm_lock_result ) +DLM_USER_LVB_LEN ]; +struct dlm_lock_result *result = (struct dlm_lock_result *)resultbuf;char *fullresult =NULL ;int status;void (*astaddr)(void *astarg); -/* Just read the header first */ - status =read (fd, result,sizeof (struct dlm_lock_result )); +/* Just read the header & LVB first */ + status =read (fd, result,sizeof (resultbuf));if (status <=0 )return -1 ;
@@ -433,6 +433,10 @@if (newstat == result->length) result = (struct dlm_lock_result *)fullresult; } +else + { + fullresult = resultbuf; + }/* Copy lksb to user's buffer - except the LVB ptr */ memcpy (result->user_lksb, &result->lksb,sizeof (struct dlm_lksb ) -sizeof (char *));
@@ -468,7 +472,7 @@astaddr (result->user_astparam); } -if (fullresult) +if (fullresult != resultbuf)free (fullresult);return 0 ; }