1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Fix the fsadm build failure without using -llvm.

* lib/misc/util.c (last_path_component): Move definition to ...
* lib/misc/last-path-component.h (last_path_component): ...here.
New file.  Make the function "static inline".
* include/.symlinks: Add last-path-component.h.
* lib/misc/util.h (last_path_component): Remove declaration.
* tools/fsadm/fsadm.c: Include "last-path-component.h".
* tools/lvmcmdline.c: Likewise.

Author: Jim Meyering <meyering@redhat.com>
This commit is contained in:
Jim Meyering 2007-10-03 16:10:04 +00:00
parent d634df5764
commit 4df0c15074
6 changed files with 31 additions and 8 deletions

View File

@ -39,6 +39,7 @@
../lib/misc/crc.h
../lib/misc/intl.h
../lib/misc/util.h
../lib/misc/last-path-component.h
../lib/misc/lib.h
../lib/misc/lvm-exec.h
../lib/misc/lvm-file.h

View File

@ -0,0 +1,27 @@
/*
* Copyright (C) 2007 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser 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
*/
/*
* Return the address of the last file name component of NAME.
* If NAME ends in a slash, return the empty string.
*/
#include <string.h>
static inline char *last_path_component(char const *name)
{
char const *slash = strrchr (name, '/');
char const *res = slash ? slash + 1 : name;
return (char *) res;
}

View File

@ -19,9 +19,4 @@
#include "lib.h"
char *last_path_component(char const *name)
{
char const *slash = strrchr (name, '/');
char const *res = slash ? slash + 1 : name;
return (char *) res;
}
/* empty for now. */

View File

@ -25,6 +25,4 @@
(void) (&_a == &_b); \
_a > _b ? _a : _b; })
char *last_path_component(char const *name);
#endif

View File

@ -39,6 +39,7 @@
#include <sys/vfs.h>
#include "util.h"
#include "last-path-component.h"
#define log_error(str, x...) fprintf(stderr, "%s(%u): " str "\n", __FILE__, __LINE__, x)

View File

@ -20,6 +20,7 @@
#include "stub.h"
#include "lvm2cmd.h"
#include "last-path-component.h"
#include <signal.h>
#include <syslog.h>