X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Futils%2Fptlctl.c;h=740e26d2f24ec46e7a3bcde105c0cb909843a928;hb=a862038b8eb1afb8f17429b8de353569234b9e0a;hp=0ecfad25aabb502cad9a64e8e7039d58d941017c;hpb=70e80ade90af09300396706b8910e196a7928520;p=fs%2Flustre-release.git diff --git a/lnet/utils/ptlctl.c b/lnet/utils/ptlctl.c index 0ecfad2..740e26d 100644 --- a/lnet/utils/ptlctl.c +++ b/lnet/utils/ptlctl.c @@ -1,7 +1,7 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * 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 +22,8 @@ #include #include -#include #include - -#include "parser.h" +#include command_t list[] = { @@ -63,14 +61,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; }