X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Futils%2Fptlctl.c;h=81e554880ac5af42c6f470489b851ba21e0f6a72;hb=5ad45a6b28a1a4da6f22a508c0a5029c4db5e4b5;hp=f6b7f4009287545d6a332d9be3e88a61f95e0ea4;hpb=dca8e8c05cff3f0961ae1c3a257d0170ebd8ee5a;p=fs%2Flustre-release.git diff --git a/lnet/utils/ptlctl.c b/lnet/utils/ptlctl.c index f6b7f40..81e5548 100644 --- a/lnet/utils/ptlctl.c +++ b/lnet/utils/ptlctl.c @@ -1,7 +1,5 @@ -/* -*- 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 (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * * This file is part of Portals, http://www.sf.net/projects/lustre/ * @@ -22,10 +20,8 @@ #include #include -#include #include - -#include "parser.h" +#include command_t list[] = { @@ -63,14 +59,25 @@ command_t list[] = { int main(int argc, char **argv) { - if (ptl_initialize(argc, argv) < 0) - exit(1); + int rc = 0; + + rc = libcfs_arch_init(); + if (rc < 0) + return rc; + + rc = ptl_initialize(argc, argv); + if (rc < 0) + goto errorout; Parser_init("ptlctl > ", list); - if (argc > 1) - return Parser_execarg(argc - 1, &argv[1], list); + if (argc > 1) { + rc = Parser_execarg(argc - 1, &argv[1], list); + goto errorout; + } Parser_commands(); - return 0; +errorout: + libcfs_arch_cleanup(); + return rc; }