X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Ftools%2Ffstype.c;h=2094bf5870b54d11d65794457df6821ec7f3eae7;hb=4e03b3d704911fb3266095866df6fd35adc3f142;hp=458f776767992b12f137a902ff512b6f2b65db81;hpb=66696d1cadedbb362c392dadce9a8ce275dd5d80;p=bacula%2Fbacula diff --git a/bacula/src/tools/fstype.c b/bacula/src/tools/fstype.c index 458f776767..2094bf5870 100644 --- a/bacula/src/tools/fstype.c +++ b/bacula/src/tools/fstype.c @@ -6,35 +6,46 @@ * Version $Id$ * */ - /* - Copyright (C) 2004 Kern Sibbald + Bacula® - The Network Backup Solution + + Copyright (C) 2004-2006 Free Software Foundation Europe e.V. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. + This program is Free Software; you can redistribute it and/or + modify it under the terms of version three of the GNU Affero General Public + License as published by the Free Software Foundation and included + in the file LICENSE. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + You should have received a copy of the GNU Affero General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. - */ + Bacula® is a registered trademark of Kern Sibbald. + The licensor of Bacula is the Free Software Foundation Europe + (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, + Switzerland, email:ftf@fsfeurope.org. +*/ #include "bacula.h" #include "findlib/find.h" +/* Dummy functions */ +int generate_daemon_event(JCR *jcr, const char *event) + { return 1; } + static void usage() { fprintf(stderr, _( "\n" -"Usage: fstype [-d debug_level] path ...\n" +"Usage: fstype [-v] path ...\n" "\n" " Print the file system type a given file/directory is on.\n" " The following options are supported:\n" @@ -50,19 +61,23 @@ static void usage() int main (int argc, char *const *argv) { - POOLMEM *fs; + char fs[1000]; int verbose = 0; int status = 0; int ch, i; + setlocale(LC_ALL, ""); + bindtextdomain("bacula", LOCALEDIR); + textdomain("bacula"); + while ((ch = getopt(argc, argv, "v?")) != -1) { switch (ch) { - case 'v': - verbose = 1; - break; - case '?': - default: - usage(); + case 'v': + verbose = 1; + break; + case '?': + default: + usage(); } } @@ -73,17 +88,18 @@ main (int argc, char *const *argv) usage(); } + OSDependentInit(); + for (i = 0; i < argc; --argc, ++argv) { - if ((fs = fstype(*argv)) != NULL) { - if (verbose) { - printf("%s: %s\n", *argv, fs); - } else { - puts(fs); - } - free(fs); + if (fstype(*argv, fs, sizeof(fs))) { + if (verbose) { + printf("%s: %s\n", *argv, fs); + } else { + puts(fs); + } } else { - fprintf(stderr, "%s: unknown\n", *argv); - status = 1; + fprintf(stderr, _("%s: unknown\n"), *argv); + status = 1; } }