Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b=21527 Portability fixes
[fs/lustre-release.git]
/
lnet
/
utils
/
debugctl.c
diff --git
a/lnet/utils/debugctl.c
b/lnet/utils/debugctl.c
index
1b6cd96
..
d8170f0
100644
(file)
--- a/
lnet/utils/debugctl.c
+++ b/
lnet/utils/debugctl.c
@@
-1,7
+1,7
@@
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Copyright
(C) 2001, 2002 Cluster File Systems, Inc.
+ * Copyright
2008 Sun Microsystems, Inc. All rights reserved
*
* This file is part of Portals, http://www.sf.net/projects/lustre/
*
*
* This file is part of Portals, http://www.sf.net/projects/lustre/
*
@@
-20,14
+20,12
@@
*
* Some day I'll split all of this functionality into a cfs_debug module
* of its own. That day is not today.
*
* Some day I'll split all of this functionality into a cfs_debug module
* of its own. That day is not today.
- *
*/
#include <stdio.h>
#include <stdlib.h>
*/
#include <stdio.h>
#include <stdlib.h>
-#include <portals/api-support.h>
-#include <portals/ptlctl.h>
-#include "parser.h"
+#include <lnet/lnetctl.h>
+#include <libcfs/libcfsutil.h>
command_t list[] = {
command_t list[] = {
@@
-50,17
+48,31
@@
command_t list[] = {
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
- if (dbg_initialize(argc, argv) < 0)
- exit(2);
+ int rc = 0;
+
+ rc = libcfs_arch_init();
+ if (rc < 0)
+ return rc;
- register_ioc_dev(PORTALS_DEV_ID, PORTALS_DEV_PATH);
+ rc = dbg_initialize(argc, argv);
+ if (rc < 0)
+ goto errorout;
+
+ register_ioc_dev(LNET_DEV_ID, LNET_DEV_PATH,
+ LNET_DEV_MAJOR, LNET_DEV_MINOR);
Parser_init("debugctl > ", list);
Parser_init("debugctl > ", list);
- if (argc > 1)
- return Parser_execarg(argc - 1, &argv[1], list);
+ if (argc > 1) {
+ rc = Parser_execarg(argc - 1, &argv[1], list);
+ unregister_ioc_dev(LNET_DEV_ID);
+ goto errorout;
+ }
Parser_commands();
Parser_commands();
- unregister_ioc_dev(PORTALS_DEV_ID);
- return 0;
+ unregister_ioc_dev(LNET_DEV_ID);
+
+errorout:
+ libcfs_arch_cleanup();
+ return rc;
}
}