X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fion-statusd%2Fion-statusd.c;h=cdf80a552d8306ae2016dc33378baa25d7240b60;hb=HEAD;hp=da9e432cd2d9b2970f0f05c31c1d6a45557627c1;hpb=a6561c9679cd701b0d50c3cfd44e4664f7df2b2f;p=ion3.git diff --git a/utils/ion-statusd/ion-statusd.c b/utils/ion-statusd/ion-statusd.c index da9e432..cdf80a5 100644 --- a/utils/ion-statusd/ion-statusd.c +++ b/utils/ion-statusd/ion-statusd.c @@ -1,12 +1,9 @@ /* * ion/utils/ion-statusd/ion-statusd.c * - * Copyright (c) Tuomo Valkonen 2004-2006. + * Copyright (c) Tuomo Valkonen 2004-2009. * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -19,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -64,19 +62,19 @@ static OptParserOpt ion_opts[]={ static const char statusd_copy[]= - "Ion-statusd " ION_VERSION ", copyright (c) Tuomo Valkonen 2004-2005."; + "Ion-statusd " ION_VERSION ", copyright (c) Tuomo Valkonen 2004-2009."; static const char statusd_license[]=DUMMY_TR( - "This program is free software; you can redistribute it and/or\n" - "modify it under the terms of the GNU Lesser General Public\n" - "License as published by the Free Software Foundation; either\n" - "version 2.1 of the License, or (at your option) any later version.\n" + "This software is licensed under the GNU Lesser General Public License\n" + "(LGPL), version 2.1, extended with terms applying to the use of the name\n" + "of the project, Ion(tm), unless otherwise indicated in components taken\n" + "from elsewhere. For details, see the file LICENSE that you should have\n" + "received with this software.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" - "Lesser General Public License for more details.\n"); + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); /* new_informs=TRUE because we should always print period when @@ -159,16 +157,21 @@ int main(int argc, char*argv[]) configtab=extl_table_none(); libtu_init(argv[0]); - extl_init(); +#ifdef CF_RELOCATABLE_BIN_LOCATION + prefix_set(argv[0], CF_RELOCATABLE_BIN_LOCATION); +#endif + + extl_init(); + if(!statusd_register_exports()) return EXIT_FAILURE; - extl_add_searchdir(EXTRABINDIR); - extl_add_searchdir(MODULEDIR); - extl_add_searchdir(ETCDIR); - extl_add_searchdir(SHAREDIR); - extl_add_searchdir(LCDIR); + prefix_wrap_simple(extl_add_searchdir, EXTRABINDIR); + prefix_wrap_simple(extl_add_searchdir, MODULEDIR); + prefix_wrap_simple(extl_add_searchdir, ETCDIR); + prefix_wrap_simple(extl_add_searchdir, SHAREDIR); + prefix_wrap_simple(extl_add_searchdir, LCDIR); extl_set_userdirs("ion3"); optparser_init(argc, argv, OPTP_MIDLONG, ion_opts); @@ -294,6 +297,7 @@ EXTL_EXPORT ExtlTab statusd_getloadavg() { ExtlTab t=extl_create_table(); +#ifndef CF_NO_GETLOADAVG double l[3]; int n; @@ -305,7 +309,7 @@ ExtlTab statusd_getloadavg() extl_table_sets_d(t, "5min", l[1]); if(n>=3) extl_table_sets_d(t, "15min", l[2]); - +#endif return t; }