LIBDM_API_FLUSH = $(shell if test -d /lib64 ; then objdump -T /lib64/libdevmapper.so* ; else objdump -T /lib/libdevmapper.so.* ; fi | grep -c dm_task_no_flush)
ifneq ($(strip $(LIBDM_API_FLUSH)),0)
- CFLAGS += -DLIBDM_API_FLUSH
+ CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
endif
all: $(LIBS)
#include "dict.h"
#include "alias.h"
#include "prio.h"
+#include "util.h"
extern int
setup_map (struct multipath * mpp)
return NULL;
if (dev_type == DEV_DEVNODE) {
- basename(dev, buff);
+ basenamecpy(dev, buff);
pp = find_path_by_dev(pathvec, buff);
if (!pp) {
condlog(0, "sysfs entry %s is not a directory\n", block_path);
return 1;
}
- basename(block_path, devname);
+ basenamecpy(block_path, devname);
return 0;
}
/*
* host / bus / target / lun
*/
- basename(parent->devpath, attr_path);
+ basenamecpy(parent->devpath, attr_path);
sscanf(attr_path, "%i:%i:%i:%i",
&pp->sg_id.host_no,
/*
* host / bus / target / lun
*/
- basename(parent->devpath, attr_path);
+ basenamecpy(parent->devpath, attr_path);
pp->sg_id.lun = 0;
sscanf(attr_path, "%i.%i.%x",
&pp->sg_id.host_no,
/*
* host / bus / target / lun
*/
- basename(dev->devpath, attr_path);
+ basenamecpy(dev->devpath, attr_path);
pp->sg_id.lun = 0;
pp->sg_id.channel = 0;
sscanf(attr_path, "cciss!c%id%i",
int sysfs_get_dev (struct sysfs_device * dev, char * buff, size_t len);
int path_discovery (vector pathvec, struct config * conf, int flag);
-void basename (char *, char *);
int do_tur (char *);
int devt2devname (char *, char *);
int path_offline (struct path *);
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE
+#endif
#include <sys/types.h>
#include <stdlib.h>
}
void
-basename (char * str1, char * str2)
+basenamecpy (char * str1, char * str2)
{
char *p = str1 + (strlen(str1) - 1);
int strcmp_chomp(char *, char *);
void strchop(char *);
-void basename (char * src, char * dst);
+void basenamecpy (char * src, char * dst);
int filepresent (char * run);
int get_word (char * sentence, char ** word);
size_t strlcpy(char *dst, const char *src, size_t size);