1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add file & line to dm_strdup_aux().

This commit is contained in:
Alasdair Kergon 2006-02-23 19:11:51 +00:00
parent 6ef080af04
commit f4db3724f9
3 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.04 -
============================
Add file & line to dm_strdup_aux().
Add setgeometry.
Version 1.02.03 - 7 Feb 2006

View File

@ -372,7 +372,7 @@ int dm_tree_node_add_target_area(struct dm_tree_node *node,
void *dm_malloc_aux(size_t s, const char *file, int line);
void *dm_malloc_aux_debug(size_t s, const char *file, int line);
char *dm_strdup_aux(const char *str);
char *dm_strdup_aux(const char *str, const char *file, int line);
void dm_free_aux(void *p);
void *dm_realloc_aux(void *p, unsigned int s, const char *file, int line);
int dm_dump_memory_debug(void);
@ -381,7 +381,7 @@ void dm_bounds_check_debug(void);
#ifdef DEBUG_MEM
# define dm_malloc(s) dm_malloc_aux_debug((s), __FILE__, __LINE__)
# define dm_strdup(s) dm_strdup_aux(s)
# define dm_strdup(s) dm_strdup_aux((s), __FILE__, __LINE__)
# define dm_free(p) dm_free_aux(p)
# define dm_realloc(p, s) dm_realloc_aux(p, s, __FILE__, __LINE__)
# define dm_dump_memory() dm_dump_memory_debug()

View File

@ -18,9 +18,9 @@
#include <assert.h>
#include <stdarg.h>
char *dm_strdup_aux(const char *str)
char *dm_strdup_aux(const char *str, const char *file, int line)
{
char *ret = dm_malloc(strlen(str) + 1);
char *ret = dm_malloc_aux_debug(strlen(str) + 1, file, line);
if (ret)
strcpy(ret, str);