[Cluster-devel] cluster/dlm/tool main.c
teigland at sourceware.org
teigland at sourceware.org
Fri Oct 26 20:57:55 UTC 2007
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2007-10-26 20:57:55
Modified files:
dlm/tool : main.c
Log message:
sync with HEAD, except deadlock stuff within #if DEADLOCK
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm/tool/main.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.7&r2=1.2.2.8
--- cluster/dlm/tool/main.c 2007/10/17 19:07:51 1.2.2.7
+++ cluster/dlm/tool/main.c 2007/10/26 20:57:55 1.2.2.8
@@ -24,7 +24,10 @@
#include <netinet/in.h>
#include "libdlm.h"
-/* #include "dlm_controld.h" */
+
+#if DEADLOCK
+#include "dlm_controld.h"
+#endif
#define OPTION_STRING "MhVvd:m:"
@@ -74,7 +77,7 @@
switch (optchar) {
case 'm':
memset(modebuf, 0, sizeof(modebuf));
- snprintf(modebuf, 8, optarg);
+ snprintf(modebuf, 8, "%s", optarg);
sscanf(modebuf, "%o", &create_mode);
break;
@@ -145,15 +148,15 @@
operation = OP_LOCKDEBUG;
opt_ind = optind + 1;
break;
- }
-#if 0
} else if (!strncmp(argv[optind], "spaces", 9) &&
(strlen(argv[optind]) == 6)) {
operation = OP_SPACES;
opt_ind = optind + 1;
need_lsname = 0;
break;
- } else if (!strncmp(argv[optind], "deadlock_check", 14) &&
+ }
+#if DEADLOCK
+ else if (!strncmp(argv[optind], "deadlock_check", 14) &&
(strlen(argv[optind]) == 14)) {
operation = OP_DEADLOCK_CHECK;
opt_ind = optind + 1;
@@ -176,7 +179,6 @@
}
}
-#if 0
static int do_write(int fd, void *buf, size_t count)
{
int rv, off = 0;
@@ -195,7 +197,6 @@
}
return 0;
}
-#endif
void do_join(char *name)
{
@@ -389,7 +390,6 @@
fclose(file);
}
-#if 0
void do_spaces(void)
{
/* TODO: get info from /sys/kernel/config/ */
@@ -419,6 +419,7 @@
return fd;
}
+#if DEADLOCK
static void do_deadlock_check(char *name)
{
char buf[DLM_CONTROLD_MSGLEN];
@@ -470,16 +471,16 @@
case OP_LOCKDEBUG:
do_lockdebug(lsname);
break;
-#if 0
+
case OP_SPACES:
do_spaces();
break;
-
+#if DEADLOCK
case OP_DEADLOCK_CHECK:
do_deadlock_check(lsname);
break;
-#endif
}
+#endif
return 0;
}
More information about the Cluster-devel
mailing list