remove unuseful MALLOC/REALLOC/STRDUP/FREE
PATCH 1/1 remove unuseful MALLOC/REALLOC/STRDUP/FREE
Now there are tools such as valgrind and asan to detect memory leaks, so it is unnecessary to use _DEBUG_. Remove _DEBUG_ code.
--- libmpathpersist/mpath_persist.c | 4 +- libmpathpersist/mpath_updatepr.c | 1 - libmultipath/Makefile | 2 +- libmultipath/alias.c | 2 +- libmultipath/blacklist.c | 27 +- libmultipath/checkers.c | 4 +- libmultipath/checkers.h | 4 +- libmultipath/checkers/emc_clariion.c | 3 +- libmultipath/config.c | 85 +++-- libmultipath/configure.c | 21 +- libmultipath/defaults.c | 1 - libmultipath/defaults.h | 1 + libmultipath/devmapper.c | 15 +- libmultipath/dict.c | 49 ++- libmultipath/discovery.c | 1 - libmultipath/dmparser.c | 47 ++- libmultipath/io_err_stat.c | 13 +- libmultipath/log.c | 22 +- libmultipath/log_pthread.c | 2 - libmultipath/memory.c | 444 ----------------------- libmultipath/memory.h | 66 ---- libmultipath/parser.c | 25 +- libmultipath/pgpolicies.c | 5 +- libmultipath/prio.c | 4 +- libmultipath/prio.h | 1 - libmultipath/prioritizers/path_latency.c | 6 +- libmultipath/prioritizers/weightedpath.c | 1 - libmultipath/propsel.c | 11 +- libmultipath/structs.c | 51 ++- libmultipath/sysfs.c | 2 +- libmultipath/uevent.c | 13 +- libmultipath/util.c | 7 +- libmultipath/util.h | 1 + libmultipath/uxsock.c | 5 +- libmultipath/vector.c | 15 +- multipath/main.c | 19 +- multipathd/cli.c | 23 +- multipathd/cli.h | 2 +- multipathd/cli_handlers.c | 7 +- multipathd/main.c | 33 +- multipathd/uxclnt.c | 5 +- multipathd/uxlsnr.c | 17 +- multipathd/waiter.c | 5 +- tests/pgpolicy.c | 1 + tests/uevent.c | 8 +- 45 files changed, 268 insertions(+), 813 deletions(-) delete mode 100644 libmultipath/memory.c delete mode 100644 libmultipath/memory.h
libmpathpersist/mpath_persist.c +2 -2
@@ -239,7 +239,7 @@ static int mpath_get_map(vector curmp, vector pathvec, int fd, char **palias, alias =NULL ; } out: -FREE (alias); +free (alias);return ret; }
@@ -342,7 +342,7 @@ static int do_mpath_persistent_reserve_out(vector curmp, vector pathvec, int fd,update_prkey (alias,0 ); } out1: -FREE (alias); +free (alias);return ret; }
libmpathpersist/mpath_updatepr.c +0 -1
@@ -14,7 +14,6 @@#include "debug.h" #include "mpath_cmd.h" #include "uxsock.h" -#include "memory.h" #include "mpathpr.h"
libmultipath/Makefile +1 -1
@@ -45,7 +45,7 @@ ifneq ($(call check_func,dm_hold_control_dev,/usr/include/libdevmapper.h),0) CFLAGS += -DLIBDM_API_HOLD_CONTROL endif -OBJS = memory.o parser.o vector.o devmapper.o callout.o \ +OBJS = parser.o vector.o devmapper.o callout.o \ hwtable.o blacklist.o util.o dmparser.o config.o \ structs.o discovery.o propsel.o dict.o \ pgpolicies.o debug.o defaults.o uevent.o time-util.o \
libmultipath/alias.c +1 -1
@@ -356,7 +356,7 @@ use_existing_alias (const char *wwid, const char *file, const char *alias_old,* allocated correctly */ if (strcmp (buff, wwid) ==0 ) - alias =STRDUP (alias_old); + alias =strdup (alias_old);else { alias =NULL ; condlog(0, "alias %s already bound to wwid %s, cannot reuse",
libmultipath/blacklist.c +13 -14
@@ -5,7 +5,6 @@#include <libudev.h> #include "checkers.h" -#include "memory.h" #include "vector.h" #include "util.h" #include "debug.h"
@@ -46,7 +45,7 @@ int store_ble(vector blist, const char *str, int origin)if (!blist) goto out; - ble =MALLOC (sizeof (struct blentry )); + ble =calloc (1 ,sizeof (struct blentry ));if (!ble) goto out;
@@ -63,9 +62,9 @@ int store_ble(vector blist, const char *str, int origin)vector_set_slot (blist, ble);return 0 ; out1: -FREE (ble); +free (ble); out: -FREE (strdup_str); +free (strdup_str);return 1 ; }
@@ -77,12 +76,12 @@ int alloc_ble_device(vector blist)if (!blist)return 1 ; - ble =MALLOC (sizeof (struct blentry_device )); + ble =calloc (1 ,sizeof (struct blentry_device ));if (!ble)return 1 ;if (!vector_alloc_slot (blist)) { -FREE (ble); +free (ble);return 1 ; }vector_set_slot (blist, ble);
@@ -105,7 +104,7 @@ int set_ble_device(vector blist, const char *vendor, const char *product, int orreturn 1 ;if (vendor) { - vendor_str =STRDUP (vendor); + vendor_str =strdup (vendor);if (!vendor_str) goto out;
@@ -116,7 +115,7 @@ int set_ble_device(vector blist, const char *vendor, const char *product, int or ble->vendor = vendor_str; }if (product) { - product_str =STRDUP (product); + product_str =strdup (product);if (!product_str) goto out1;
@@ -216,7 +215,7 @@ setup_default_blist (struct config * conf) VECTOR_SIZE(conf->blist_device) - 1);if (set_ble_device (conf->blist_device, hwe->vendor, hwe->bl_product,ORIGIN_DEFAULT )) { -FREE (ble); +free (ble);vector_del_slot (conf->blist_device,VECTOR_SIZE (conf->blist_device) -1 );return 1 ; }
@@ -445,8 +444,8 @@ static void free_ble(struct blentry *ble)if (!ble)return ;regfree (&ble->regex); -FREE (ble->str); -FREE (ble); +free (ble->str); +free (ble); }void
@@ -488,13 +487,13 @@ static void free_ble_device(struct blentry_device *ble)if (ble) {if (ble->vendor) {regfree (&ble->vendor_reg); -FREE (ble->vendor); +free (ble->vendor); }if (ble->product) {regfree (&ble->product_reg); -FREE (ble->product); +free (ble->product); } -FREE (ble); +free (ble); } }
libmultipath/checkers.c +2 -2
@@ -55,7 +55,7 @@ static struct checker_class *alloc_checker_class(void) {struct checker_class *c; - c =MALLOC (sizeof (struct checker_class )); + c =calloc (1 ,sizeof (struct checker_class ));if (c) {INIT_LIST_HEAD (&c->node);uatomic_set (&c->refcount,1 );
@@ -96,7 +96,7 @@ void free_checker_class(struct checker_class *c) c->name, dlerror()); } } -FREE (c); +free (c); }void cleanup_checkers (void )
libmultipath/checkers.h +1 -3
@@ -3,7 +3,6 @@#include <pthread.h> #include "list.h" -#include "memory.h" #include "defaults.h" /*
@@ -127,8 +126,7 @@ struct checker {short msgid;/* checker-internal extra status */ void * context;/* store for persistent data */ void ** mpcontext;/* store for persistent data shared -multipath-wide. Use MALLOC if -you want to stuff data in. */ +multipath-wide. */ };static inline int checker_selected (const struct checker *c)
libmultipath/checkers/emc_clariion.c +1 -2
@@ -15,7 +15,6 @@#include "libsg.h" #include "checkers.h" #include "debug.h" -#include "memory.h" #define INQUIRY_CMD 0x12#define INQUIRY_CMDLEN 6
@@ -102,7 +101,7 @@ int libcheck_init (struct checker * c)/* * Allocate and initialize the path specific context. */ - c->context =MALLOC (sizeof (struct emc_clariion_checker_path_context )); + c->context =calloc (1 ,sizeof (struct emc_clariion_checker_path_context ));if (!c->context)return 1 ; ((struct emc_clariion_checker_path_context *)c->context)->wwn_set =0 ;
libmultipath/config.c +42 -43
201 lines not on this page · raw message
libmultipath/configure.c +10 -11
@@ -19,7 +19,6 @@#include "checkers.h" #include "vector.h" -#include "memory.h" #include "devmapper.h" #include "defaults.h" #include "structs.h"
@@ -751,8 +750,8 @@ void select_action (struct multipath *mpp, const struct _vector *curmp, mpp->wwid, cmpp->alias, mpp->alias, mpp->alias, cmpp_by_name->wwid);/* reset alias to existing alias */ -FREE (mpp->alias); - mpp->alias =STRDUP (cmpp->alias); +free (mpp->alias); + mpp->alias =strdup (cmpp->alias); mpp->action =ACT_IMPOSSIBLE ;return ; }
@@ -803,8 +802,8 @@ void select_action (struct multipath *mpp, const struct _vector *curmp,return ; } - cmpp_feat =STRDUP (cmpp->features); - mpp_feat =STRDUP (mpp->features); + cmpp_feat =strdup (cmpp->features); + mpp_feat =strdup (mpp->features);if (cmpp_feat && mpp_feat) {remove_feature (&mpp_feat,"queue_if_no_path" );remove_feature (&mpp_feat,"retain_attached_hw_handler" );
@@ -812,13 +811,13 @@ void select_action (struct multipath *mpp, const struct _vector *curmp,remove_feature (&cmpp_feat,"retain_attached_hw_handler" );if (strcmp (mpp_feat, cmpp_feat)) {select_reload_action (mpp,"features change" ); -FREE (cmpp_feat); -FREE (mpp_feat); +free (cmpp_feat); +free (mpp_feat);return ; } } -FREE (cmpp_feat); -FREE (mpp_feat); +free (cmpp_feat); +free (mpp_feat);if (!cmpp->selector ||strncmp (cmpp->selector, mpp->selector,strlen (mpp->selector))) {
@@ -1087,7 +1086,7 @@ check_daemon(void) ret =1 ; out_free: -FREE (reply); +free (reply); out:mpath_disconnect (fd);return ret;
@@ -1430,7 +1429,7 @@ static int _get_refwwid(enum mpath_cmds cmd, const char *dev, }if (refwwid &&strlen (refwwid)) { - *wwid =STRDUP (refwwid); + *wwid =strdup (refwwid);return PATHINFO_OK ; }
libmultipath/defaults.c +0 -1
@@ -4,6 +4,5 @@#include <string.h> #include "defaults.h" -#include "memory.h" const char *const default_partition_delim =DEFAULT_PARTITION_DELIM ;
libmultipath/defaults.h +1 -0
@@ -1,6 +1,7 @@#ifndef _DEFAULTS_H#define _DEFAULTS_H#include <limits.h> +#include <string.h> /* * If you add or modify a value also update multipath/multipath.conf.5
libmultipath/devmapper.c +7 -8
@@ -21,7 +21,6 @@#include "vector.h" #include "structs.h" #include "debug.h" -#include "memory.h" #include "devmapper.h" #include "sysfs.h" #include "config.h"
@@ -474,7 +473,7 @@ dm_addmap (int task, const char *target, struct multipath *mpp,dm_task_set_ro (dmt);if (task ==DM_DEVICE_CREATE ) { - prefixed_uuid =MALLOC (UUID_PREFIX_LEN + + prefixed_uuid =calloc (1 ,UUID_PREFIX_LEN +strlen (mpp->wwid) +1 );if (!prefixed_uuid) { condlog(0, "cannot create prefixed uuid : %s",
@@ -517,7 +516,7 @@ dm_addmap (int task, const char *target, struct multipath *mpp,libmp_udev_wait (cookie); freeout:if (prefixed_uuid) -FREE (prefixed_uuid); +free (prefixed_uuid); addout:dm_task_destroy (dmt);
@@ -1285,7 +1284,7 @@ struct multipath *dm_get_multipath(const char *name)if (!mpp)return NULL ; - mpp->alias =STRDUP (name); + mpp->alias =strdup (name);if (!mpp->alias) goto out;
@@ -1420,7 +1419,7 @@ dm_mapname(int major, int minor) map =dm_task_get_name (dmt);if (map &&strlen (map)) - response =STRDUP ((const char *)map); + response =strdup ((const char *)map);dm_task_destroy (dmt);return response;
@@ -1598,7 +1597,7 @@ dm_cancel_deferred_remove (struct multipath *mpp __attribute__((unused)))static struct dm_info *alloc_dminfo (void ) { -return MALLOC (sizeof (struct dm_info )); +return calloc (1 ,sizeof (struct dm_info )); }int
@@ -1614,7 +1613,7 @@ dm_get_info (const char * mapname, struct dm_info ** dmi)return 1 ;if (do_get_info (mapname, *dmi) !=0 ) { -FREE (*dmi); +free (*dmi); *dmi =NULL ;return 1 ; }
@@ -1715,7 +1714,7 @@ void dm_reassign_deps(char *table, const char *dep, const char *newdep) n +=strlen (newdep); p +=strlen (dep);strcat (n, p); -FREE (newtable); +free (newtable); }int dm_reassign_table (const char *name,char *old,char *new)
libmultipath/dict.c +24 -25
196 lines not on this page · raw message
libmultipath/discovery.c +0 -1
@@ -17,7 +17,6 @@#include "checkers.h" #include "vector.h" -#include "memory.h" #include "util.h" #include "structs.h" #include "config.h"
libmultipath/dmparser.c +23 -24
184 lines not on this page · raw message
libmultipath/io_err_stat.c +7 -6
@@ -22,9 +22,9 @@#include <errno.h> #include <sys/mman.h> #include <sys/select.h> +#include <stdio.h> #include "vector.h" -#include "memory.h" #include "checkers.h" #include "config.h" #include "structs.h"
@@ -132,7 +132,7 @@ static int setup_directio_ctx(struct io_err_stat_path *p)if (p->fd <0 )return 1 ; - p->dio_ctx_array =MALLOC (sizeof (struct dio_ctx ) *CONCUR_NR_EVENT ); + p->dio_ctx_array =calloc (1 ,sizeof (struct dio_ctx ) *CONCUR_NR_EVENT );if (!p->dio_ctx_array) goto fail_close;
@@ -154,7 +154,8 @@ deinit:for (i =0 ; i <CONCUR_NR_EVENT ; i++)deinit_each_dio_ctx (p->dio_ctx_array + i); free_pdctx: -FREE (p->dio_ctx_array); +free (p->dio_ctx_array); + p->dio_ctx_array =NULL ; fail_close:close (p->fd);
@@ -174,19 +175,19 @@ static void free_io_err_stat_path(struct io_err_stat_path *p)for (i =0 ; i <CONCUR_NR_EVENT ; i++)deinit_each_dio_ctx (p->dio_ctx_array + i); -FREE (p->dio_ctx_array); +free (p->dio_ctx_array);if (p->fd >0 )close (p->fd); free_path: -FREE (p); +free (p); }static struct io_err_stat_path *alloc_io_err_stat_path (void ) {struct io_err_stat_path *p; - p = (struct io_err_stat_path *)MALLOC (sizeof (*p)); + p = (struct io_err_stat_path *)calloc (1 ,sizeof (*p));if (!p)return NULL ;
libmultipath/log.c +12 -10
@@ -11,7 +11,6 @@#include <time.h> #include <pthread.h> -#include "memory.h" #include "log.h" #include "util.h"
@@ -44,7 +43,7 @@ static void dump_logarea (void)static int logarea_init (int size) {logdbg (stderr,"enter logarea_init\n" ); - la = (struct logarea *)MALLOC (sizeof (struct logarea )); + la = (struct logarea *)calloc (1 ,sizeof (struct logarea ));if (!la)return 1 ;
@@ -52,9 +51,10 @@ static int logarea_init (int size)if (size <MAX_MSG_SIZE ) size =DEFAULT_AREA_SIZE ; - la->start =MALLOC (size); + la->start =calloc (1 , size);if (!la->start) { -FREE (la); +free (la); + la =NULL ;return 1 ; }
@@ -63,11 +63,12 @@ static int logarea_init (int size) la->head = la->start; la->tail = la->start; - la->buff =MALLOC (MAX_MSG_SIZE +sizeof (struct logmsg )); + la->buff =calloc (1 ,MAX_MSG_SIZE +sizeof (struct logmsg ));if (!la->buff) { -FREE (la->start); -FREE (la); +free (la->start); +free (la); + la =NULL ;return 1 ; }return 0 ;
@@ -94,9 +95,10 @@ int log_init(char *program_name, int size)static void free_logarea (void ) { -FREE (la->start); -FREE (la->buff); -FREE (la); +free (la->start); +free (la->buff); +free (la); + la =NULL ;return ; }
libmultipath/log_pthread.c +0 -2
@@ -8,8 +8,6 @@#include <pthread.h> #include <sys/mman.h> -#include "memory.h" -#include "log_pthread.h" #include "log.h" #include "lock.h"
libmultipath/memory.c deleted +0 -444
444 lines not on this page · raw message
libmultipath/memory.h deleted +0 -66
66 lines not on this page · raw message
libmultipath/parser.c +12 -13
@@ -23,7 +23,6 @@#include "vector.h" #include "config.h" #include "parser.h" -#include "memory.h" #include "debug.h" #include "strbuf.h"
@@ -39,13 +38,13 @@ keyword_alloc(vector keywords, char *string, {struct keyword *keyword; - keyword = (struct keyword *)MALLOC (sizeof (struct keyword )); + keyword = (struct keyword *)calloc (1 ,sizeof (struct keyword ));if (!keyword)return 1 ;if (!vector_alloc_slot (keywords)) { -FREE (keyword); +free (keyword);return 1 ; } keyword->string = string;
@@ -115,7 +114,7 @@ free_keywords(vector keywords) keyword =VECTOR_SLOT (keywords, i);if (keyword->sub)free_keywords (keyword->sub); -FREE (keyword); +free (keyword); }vector_free (keywords); }
@@ -245,7 +244,7 @@ alloc_strvec(char *string) start = cp;if (*cp =='"' && !(in_string && *(cp +1 ) =='"' )) { cp++; - token =MALLOC (sizeof (quote_marker)); + token =calloc (1 ,sizeof (quote_marker));if (!token) goto out;
@@ -256,7 +255,7 @@ alloc_strvec(char *string)else in_string =1 ; }else if (!in_string && (*cp =='{' || *cp =='}' )) { - token =MALLOC (2 ); + token =malloc (2 );if (!token) goto out;
@@ -283,7 +282,7 @@ alloc_strvec(char *string) } strlen = cp - start; - token =MALLOC (strlen +1 ); + token =calloc (1 , strlen +1 );if (!token) goto out;
@@ -350,7 +349,7 @@ set_value(vector strvec) (char *)VECTOR_SLOT(strvec, 0));return NULL ; } - alloc =MALLOC (sizeof (char ) * (size +1 )); + alloc =calloc (1 ,sizeof (char ) * (size +1 ));if (alloc)memcpy (alloc, str, size);else
@@ -358,7 +357,7 @@ set_value(vector strvec)return alloc; }/* Even empty quotes counts as a value (An empty string) */ - alloc = (char *)MALLOC (sizeof (char )); + alloc = (char *)calloc (1 ,sizeof (char ));if (!alloc) goto oom;for (i =2 ; i <VECTOR_SIZE (strvec); i++) {
@@ -375,9 +374,9 @@ set_value(vector strvec)/* The first +1 is for the NULL byte. The rest are for the * spaces between words */ len +=strlen (str) +1 ; - alloc =REALLOC (alloc,sizeof (char ) * len); + alloc =realloc (alloc,sizeof (char ) * len);if (!alloc) { -FREE (tmp); +free (tmp); goto oom; }if (*alloc !='\0' )
@@ -518,7 +517,7 @@ process_stream(struct config *conf, FILE *stream, vector keywords,if (!uniques)return 1 ; - buf =MALLOC (MAXBUF ); + buf =calloc (1 ,MAXBUF );if (!buf) {vector_free (uniques);
@@ -590,7 +589,7 @@ process_stream(struct config *conf, FILE *stream, vector keywords,if (kw_level ==1 )condlog (1 ,"missing '%s' at end of %s" ,EOB , file); out: -FREE (buf); +free (buf);free_uniques (uniques);return r; }
libmultipath/pgpolicies.c +2 -3
@@ -8,7 +8,6 @@#include "checkers.h" #include "util.h" -#include "memory.h" #include "vector.h" #include "structs.h" #include "pgpolicies.h"
@@ -244,12 +243,12 @@ int group_by_match(struct multipath * mp, vector paths, } } } -FREE (bitmap); +free (bitmap);return 0 ; out2:free_pathgroup (pgp,KEEP_PATHS ); out1: -FREE (bitmap); +free (bitmap); out:free_pgvec (mp->pg,KEEP_PATHS ); mp->pg =NULL ;
libmultipath/prio.c +2 -2
@@ -51,7 +51,7 @@ static struct prio * alloc_prio (void) {struct prio *p; - p =MALLOC (sizeof (struct prio )); + p =calloc (1 ,sizeof (struct prio ));if (p) {INIT_LIST_HEAD (&p->node); p->refcount =1 ;
@@ -77,7 +77,7 @@ void free_prio (struct prio * p) p->name, dlerror()); } } -FREE (p); +free (p); }void cleanup_prio (void )
libmultipath/prio.h +0 -1
@@ -11,7 +11,6 @@struct path ;#include "list.h" -#include "memory.h" #include "defaults.h" /*
libmultipath/prioritizers/path_latency.c +3 -3
@@ -158,7 +158,7 @@ static int get_ionum_and_basenum(char *args, int *ionum, double *basenum)return 0 ; } - arg = temp =STRDUP (args); + arg = temp =strdup (args);if (!arg)return 0 ;
@@ -185,10 +185,10 @@ static int get_ionum_and_basenum(char *args, int *ionum, double *basenum)if (check_args_valid (*ionum, *basenum) ==0 ) goto out; -FREE (arg); +free (arg);return 1 ; out: -FREE (arg); +free (arg);return 0 ; }
libmultipath/prioritizers/weightedpath.c +0 -1
@@ -29,7 +29,6 @@#include "weightedpath.h" #include "config.h" #include "structs.h" -#include "memory.h" #include "debug.h" #include <regex.h> #include "structs_vec.h"
libmultipath/propsel.c +5 -6
@@ -7,7 +7,6 @@#include "nvme-lib.h" #include "checkers.h" -#include "memory.h" #include "vector.h" #include "structs.h" #include "config.h"
@@ -255,7 +254,7 @@ int select_selector(struct config *conf, struct multipath * mp)mp_set_conf (selector);mp_set_default (selector,DEFAULT_SELECTOR ); out: - mp->selector =STRDUP (mp->selector); + mp->selector =strdup (mp->selector);condlog (3 ,"%s: path_selector = \"%s\" %s" , mp->alias, mp->selector, origin);return 0 ;
@@ -303,7 +302,7 @@ int select_alias(struct config *conf, struct multipath * mp)const char *origin =NULL ;if (mp->mpe && mp->mpe->alias) { - mp->alias =STRDUP (mp->mpe->alias); + mp->alias =strdup (mp->mpe->alias); origin = multipaths_origin; goto out; }
@@ -329,7 +328,7 @@ int select_alias(struct config *conf, struct multipath * mp) } out:if (mp->alias ==NULL ) { - mp->alias =STRDUP (mp->wwid); + mp->alias =strdup (mp->wwid); origin ="(setting: default to WWID)" ; }if (mp->alias)
@@ -399,7 +398,7 @@ int select_features(struct config *conf, struct multipath *mp)mp_set_conf (features);mp_set_default (features,DEFAULT_FEATURES ); out: - mp->features =STRDUP (mp->features); + mp->features =strdup (mp->features); reconcile_features_with_options(mp->alias, &mp->features, &mp->no_path_retry,
@@ -477,7 +476,7 @@ out: mp->hwhandler =DEFAULT_HWHANDLER ; origin = tpgs_origin; } - mp->hwhandler =STRDUP (mp->hwhandler); + mp->hwhandler =strdup (mp->hwhandler);condlog (3 ,"%s: hardware_handler = \"%s\" %s" , mp->alias, mp->hwhandler, origin);return 0 ;
libmultipath/structs.c +25 -26
195 lines not on this page · raw message
libmultipath/sysfs.c +1 -1
@@ -287,7 +287,7 @@ int sysfs_check_holders(char * check_devt, char * new_devt) table_name, check_devt, new_devt);dm_reassign_table (table_name, check_devt, new_devt); -FREE (table_name); +free (table_name); }closedir (dirfd);
libmultipath/uevent.c +6 -7
@@ -43,7 +43,6 @@#include <libudev.h> #include <errno.h> -#include "memory.h" #include "debug.h" #include "list.h" #include "uevent.h"
@@ -81,7 +80,7 @@ int is_uevent_busy(void)struct uevent *alloc_uevent (void ) { -struct uevent *uev =MALLOC (sizeof (struct uevent )); +struct uevent *uev =calloc (1 ,sizeof (struct uevent ));if (uev) {INIT_LIST_HEAD (&uev->node);
@@ -100,7 +99,7 @@ static void uevq_cleanup(struct list_head *tmpq)if (uev->udev)udev_device_unref (uev->udev); -FREE (uev); +free (uev); } }
@@ -309,7 +308,7 @@ uevent_prepare(struct list_head *tmpq)list_del_init (&uev->node);if (uev->udev)udev_device_unref (uev->udev); -FREE (uev); +free (uev);continue ; }
@@ -337,7 +336,7 @@ uevent_filter(struct uevent *later, struct list_head *tmpq)list_del_init (&earlier->node);if (earlier->udev)udev_device_unref (earlier->udev); -FREE (earlier); +free (earlier); } } }
@@ -391,7 +390,7 @@ service_uevq(struct list_head *tmpq)if (uev->udev)udev_device_unref (uev->udev); -FREE (uev); +free (uev); } }
@@ -492,7 +491,7 @@ static struct uevent *uevent_from_udev_device(struct udev_device *dev)if (!uev->devpath || ! uev->action) {udev_device_unref (dev);condlog (1 ,"uevent missing necessary fields" ); -FREE (uev); +free (uev);return NULL ; } uev->udev = dev;
libmultipath/util.c +3 -4
@@ -17,7 +17,6 @@#include "util.h" #include "debug.h" -#include "memory.h" #include "checkers.h" #include "vector.h" #include "structs.h"
@@ -110,7 +109,7 @@ get_word (const char *sentence, char **word)if (!word)return skip + len; - *word =MALLOC (len +1 ); + *word =calloc (1 , len +1 );if (!*word) {condlog (0 ,"get_word : oom" );
@@ -414,8 +413,8 @@ void free_scandir_result(struct scandir_result *res)int i;for (i =0 ; i < res->n; i++) -FREE (res->di[i]); -FREE (res->di); +free (res->di[i]); +free (res->di); }void close_fd (void *arg)
libmultipath/util.h +1 -0
@@ -9,6 +9,7 @@#include <sys/resource.h> #include <inttypes.h> #include <stdbool.h> +#include <stdio.h> size_t strchop (char *);int basenamecpy (const char *src,char *dst,size_t size);
libmultipath/uxsock.c +2 -3
@@ -21,7 +21,6 @@#endif #include "mpath_cmd.h" -#include "memory.h" #include "uxsock.h" #include "debug.h"
@@ -110,12 +109,12 @@ static int _recv_packet(int fd, char **buf, unsigned int timeout, ssize_t limit)return -errno;if ((limit >0 ) && (len > limit))return -EINVAL ; - (*buf) =MALLOC (len); + (*buf) =calloc (1 , len);if (!*buf)return -ENOMEM ; err =mpath_recv_reply_data (fd, *buf, len, timeout);if (err !=0 ) { -FREE (*buf); +free (*buf); (*buf) =NULL ;return -errno; }
libmultipath/vector.c +7 -8
@@ -19,7 +19,6 @@* Copyright (c) 2005 Christophe Varoqui */ -#include "memory.h" #include <stdlib.h> #include "vector.h"
@@ -30,7 +29,7 @@vector vector_alloc (void ) { -vector v = (vector )MALLOC (sizeof (struct _vector )); +vector v = (vector )calloc (1 ,sizeof (struct _vector ));return v; }
@@ -46,7 +45,7 @@ vector_alloc_slot(vector v)return false; new_allocated = v->allocated +VECTOR_DEFAULT_SIZE ; - new_slot =REALLOC (v->slot,sizeof (void *) * new_allocated); + new_slot =realloc (v->slot,sizeof (void *) * new_allocated);if (!new_slot)return false;
@@ -119,13 +118,13 @@ vector_del_slot(vector v, int slot) v->allocated -=VECTOR_DEFAULT_SIZE ;if (v->allocated <=0 ) { -FREE (v->slot); +free (v->slot); v->slot =NULL ; v->allocated =0 ; }else {void *new_slot; - new_slot =REALLOC (v->slot,sizeof (void *) * v->allocated); + new_slot =realloc (v->slot,sizeof (void *) * v->allocated);if (!new_slot) v->allocated +=VECTOR_DEFAULT_SIZE ;else
@@ -153,7 +152,7 @@ vector_reset(vector v)return NULL ;if (v->slot) -FREE (v->slot); +free (v->slot); v->allocated =0 ; v->slot =NULL ;
@@ -166,7 +165,7 @@ vector_free(vector v) {if (!vector_reset (v))return ; -FREE (v); +free (v); }void
@@ -180,7 +179,7 @@ free_strvec(vector strvec) vector_foreach_slot (strvec, str, i)if (str) -FREE (str); +free (str);vector_free (strvec); }
multipath/main.c +6 -13
@@ -35,7 +35,6 @@#include "checkers.h" #include "prio.h" #include "vector.h" -#include "memory.h" #include <libdevmapper.h> #include "devmapper.h" #include "util.h"
@@ -82,7 +81,7 @@ dump_config (struct config *conf, vector hwes, vector mpvec)if (reply !=NULL ) {printf ("%s" , reply); -FREE (reply); +free (reply);return 0 ; }else return 1 ;
@@ -286,7 +285,7 @@ found:condlog (r ==0 ?3 :2 ,"%s:%s usable paths found" , devpath, r ==0 ?"" :" no" ); free: -FREE (mapname); +free (mapname);free_multipath (mpp,FREE_PATHS );vector_free (pathvec); out:
@@ -585,7 +584,7 @@ out:condlog (2 ,"Warning: multipath devices exist, but multipathd service is not running" );if (refwwid) -FREE (refwwid); +free (refwwid);free_multipathvec (curmp,KEEP_PATHS ); vecs.mpvec =NULL ;
@@ -808,7 +807,7 @@ int delegate_to_multipathd(enum mpath_cmds cmd, } out: -FREE (reply); +free (reply);close (fd);return r; }
@@ -888,9 +887,6 @@ main (int argc, char *argv[])break ;case 'M' : -#if _DEBUG_ - debug =atoi (optarg); -#endif break ;case 'p' : conf->pgpolicy_flag =get_pgpolicy_id (optarg);
@@ -964,7 +960,7 @@ main (int argc, char *argv[])check_alias_settings (conf);if (optind < argc) { - dev =MALLOC (FILE_NAME_SIZE ); + dev =calloc (1 ,FILE_NAME_SIZE );if (!dev) goto out;
@@ -1075,13 +1071,10 @@ main (int argc, char *argv[]) out:put_multipath_config (conf);if (dev) -FREE (dev); +free (dev);if (dev_type ==DEV_UEVENT )closelog (); -#ifdef _DEBUG_ -dbg_free_final (NULL ); -#endif return r; }
multipathd/cli.c +11 -12
@@ -4,7 +4,6 @@#include <sys/time.h> #include <errno.h> #include <pthread.h> -#include "memory.h" #include "vector.h" #include "structs.h" #include "structs_vec.h"
@@ -24,13 +23,13 @@ static vector handlers;static struct key *alloc_key (void ) { -return (struct key *)MALLOC (sizeof (struct key )); +return (struct key *)calloc (1 ,sizeof (struct key )); }static struct handler *alloc_handler (void ) { -return (struct handler *)MALLOC (sizeof (struct handler )); +return (struct handler *)calloc (1 ,sizeof (struct handler )); } static int
@@ -45,7 +44,7 @@ add_key (vector vec, char * str, uint64_t code, int has_param) kw->code = code; kw->has_param = has_param; - kw->str =STRDUP (str); + kw->str =strdup (str);if (!kw->str) goto out;
@@ -58,9 +57,9 @@ add_key (vector vec, char * str, uint64_t code, int has_param)return 0 ; out1: -FREE (kw->str); +free (kw->str); out: -FREE (kw); +free (kw);return 1 ; }
@@ -75,7 +74,7 @@ add_handler (uint64_t fp, int (*fn)(void *, char **, int *, void *))return 1 ;if (!vector_alloc_slot (handlers)) { -FREE (h); +free (h);return 1 ; }
@@ -127,12 +126,12 @@ static void free_key (struct key * kw) {if (kw->str) -FREE (kw->str); +free (kw->str);if (kw->param) -FREE (kw->param); +free (kw->param); -FREE (kw); +free (kw); }void
@@ -154,7 +153,7 @@ free_handlers (void)struct handler * h; vector_foreach_slot (handlers, h, i) -FREE (h); +free (h);vector_free (handlers); handlers =NULL ;
@@ -303,7 +302,7 @@ get_cmdvec (char * cmd, vector *v) goto out; }if (!vector_alloc_slot (cmdvec)) { -FREE (cmdkw); +free (cmdkw); r =ENOMEM ; goto out; }
multipathd/cli.h +1 -1
@@ -106,7 +106,7 @@ enum {free (tmp); \ (r) =NULL ; \ }else { \ - (r) =REALLOC ((r), (m) *2 ); \ + (r) =realloc ((r), (m) *2 ); \if ((r)) { \memset ((r) + (m),0 , (m)); \ (m) *=2 ; \
multipathd/cli_handlers.c +3 -4
@@ -5,7 +5,6 @@#define _GNU_SOURCE#include "checkers.h" -#include "memory.h" #include "vector.h" #include "structs.h" #include "structs_vec.h"
@@ -746,7 +745,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data) != CP_OK)condlog (2 ,"%s: coalesce_paths failed" , param); -FREE (refwwid); +free (refwwid); } }/*we attempt to create device only once*/ count++;
@@ -757,7 +756,7 @@ cli_add_map (void * v, char ** reply, int * len, void * data)return 1 ; } rc =ev_add_map (dev_path, alias, vecs); -FREE (alias); +free (alias);return rc; }
@@ -783,7 +782,7 @@ cli_del_map (void * v, char ** reply, int * len, void * data)return 1 ; } rc =ev_remove_map (param, alias, minor, vecs); -FREE (alias); +free (alias);return rc; }
multipathd/main.c +14 -19
@@ -38,7 +38,6 @@*/ #include "parser.h" #include "vector.h" -#include "memory.h" #include "config.h" #include "util.h" #include "hwtable.h"
@@ -552,11 +551,11 @@ add_map_without_path (struct vectors *vecs, const char *alias)if (!mpp)return NULL ;if (!alias) { -FREE (mpp); +free (mpp);return NULL ; } - mpp->alias =STRDUP (alias); + mpp->alias =strdup (alias);if (dm_get_info (mpp->alias, &mpp->dmi)) {condlog (3 ,"%s: cannot access table" , mpp->alias);
@@ -702,7 +701,7 @@ uev_add_map (struct uevent * uev, struct vectors * vecs)pthread_testcancel (); rc =ev_add_map (uev->kernel, alias, vecs);lock_cleanup_pop (vecs->lock); -FREE (alias); +free (alias);return rc; }
@@ -808,7 +807,7 @@ uev_remove_map (struct uevent * uev, struct vectors * vecs)remove_map_and_stop_waiter (mpp, vecs); out:lock_cleanup_pop (vecs->lock); -FREE (alias); +free (alias);return 0 ; }
@@ -1461,11 +1460,11 @@ uev_pathfail_check(struct uevent *uev, struct vectors *vecs) pp->dev); out_lock:lock_cleanup_pop (vecs->lock); -FREE (devt); -FREE (action); +free (devt); +free (action);return r; out: -FREE (action); +free (action);return 1 ; }
@@ -1501,7 +1500,7 @@ uxsock_trigger (char * str, char ** reply, int * len, bool is_root,if ((str !=NULL ) && (is_root == false) && (strncmp (str,"list" ,strlen ("list" )) !=0 ) && (strncmp (str,"show" ,strlen ("show" )) !=0 )) { - *reply =STRDUP ("permission deny: need to be root" ); + *reply =strdup ("permission deny: need to be root" );if (*reply) *len =strlen (*reply) +1 ;return 1 ;
@@ -1511,15 +1510,15 @@ uxsock_trigger (char * str, char ** reply, int * len, bool is_root,if (r >0 ) {if (r ==ETIMEDOUT ) - *reply =STRDUP ("timeout\n" ); + *reply =strdup ("timeout\n" );else - *reply =STRDUP ("fail\n" ); + *reply =strdup ("fail\n" );if (*reply) *len =strlen (*reply) +1 ; r =1 ; }else if (!r && *len ==0 ) { - *reply =STRDUP ("ok\n" ); + *reply =strdup ("ok\n" );if (*reply) *len =strlen (*reply) +1 ; r =0 ;
@@ -2800,7 +2799,7 @@ init_vecs (void) {struct vectors * vecs; - vecs = (struct vectors *)MALLOC (sizeof (struct vectors )); + vecs = (struct vectors *)calloc (1 ,sizeof (struct vectors ));if (!vecs)return NULL ;
@@ -3012,7 +3011,7 @@ static void cleanup_vecs(void)cleanup_maps (gvecs);cleanup_paths (gvecs);pthread_mutex_destroy (&gvecs->lock.mutex); -FREE (gvecs); +free (gvecs); }static void cleanup_threads (void )
@@ -3110,10 +3109,6 @@ static void cleanup_child(void)log_thread_stop ();cleanup_conf (); - -#ifdef _DEBUG_ -dbg_free_final (NULL ); -#endif }static int sd_notify_exit (int err)
@@ -3555,7 +3550,7 @@ void * mpath_pr_event_handler_fn (void * pathp ) goto out; } - param = (struct prout_param_descriptor *)MALLOC (sizeof (struct prout_param_descriptor )); + param = (struct prout_param_descriptor *)calloc (1 ,sizeof (struct prout_param_descriptor ));if (!param) goto out;
multipathd/uxclnt.c +2 -3
@@ -20,7 +20,6 @@#include "mpath_cmd.h" #include "uxsock.h" -#include "memory.h" #include "defaults.h" #include "vector.h"
@@ -99,7 +98,7 @@ static void process(int fd, unsigned int timeout)add_history (line);free (line); -FREE (reply); +free (reply); } }
@@ -122,7 +121,7 @@ static int process_req(int fd, char * inbuf, unsigned int timeout) }else {printf ("%s" , reply); ret = (strcmp (reply,"fail\n" ) ==0 ); -FREE (reply); +free (reply);return ret; } }
multipathd/uxlsnr.c +8 -9
@@ -25,7 +25,6 @@#include <stdbool.h> #include <sys/inotify.h> #include "checkers.h" -#include "memory.h" #include "debug.h" #include "vector.h" #include "structs.h"
@@ -99,12 +98,11 @@ static void new_client(int ux_sock)if (fd ==-1 )return ; - c = (struct client *)MALLOC (sizeof (*c)); + c = (struct client *)calloc (1 ,sizeof (*c));if (!c) {close (fd);return ; } -memset (c,0 ,sizeof (*c));INIT_LIST_HEAD (&c->node); c->fd = fd;
@@ -122,7 +120,7 @@ static void _dead_client(struct client *c)int fd = c->fd;list_del_init (&c->node); c->fd =-1 ; -FREE (c); +free (c);close (fd); }
@@ -137,7 +135,8 @@ static void dead_client(struct client *c)static void free_polls (void ) {if (polls) -FREE (polls); +free (polls); + polls =NULL ; } static void check_timeout(struct timespec start_time, char *inbuf,
@@ -299,7 +298,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, long ux_sock,struct watch_descriptors wds = { .conf_wd =-1 , .dir_wd =-1 };condlog (3 ,"uxsock: startup listener" ); - polls =MALLOC (max_pfds *sizeof (*polls)); + polls =calloc (1 , max_pfds *sizeof (*polls));if (!polls) {condlog (0 ,"uxsock: failed to allocate poll fds" );exit_daemon ();
@@ -327,7 +326,7 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, long ux_sock,struct pollfd *new;int n_new = max_pfds +POLLFD_CHUNK ; - new =REALLOC (polls, n_new *sizeof (*polls)); + new =realloc (polls, n_new *sizeof (*polls));if (new) { max_pfds = n_new; polls = new;
@@ -448,12 +447,12 @@ void * uxsock_listen(uxsock_trigger_fn uxsock_trigger, long ux_sock,"Reply [%d bytes]" , i, rlen); } -FREE (reply); +free (reply); reply =NULL ; }check_timeout (start_time, inbuf, uxsock_timeout); -FREE (inbuf); +free (inbuf); } }/* see if we got a non-fatal signal */
multipathd/waiter.c +2 -3
@@ -13,7 +13,6 @@#include "util.h" #include "vector.h" -#include "memory.h" #include "checkers.h" #include "config.h" #include "structs.h"
@@ -32,7 +31,7 @@ static struct event_thread *alloc_waiter (void)struct event_thread *wp; - wp = (struct event_thread *)MALLOC (sizeof (struct event_thread )); + wp = (struct event_thread *)calloc (1 ,sizeof (struct event_thread ));return wp; }
@@ -45,7 +44,7 @@ static void free_waiter (void *data)dm_task_destroy (wp->dmt);rcu_unregister_thread (); -FREE (wp); +free (wp); }void stop_waiter_thread (struct multipath *mpp)
tests/pgpolicy.c +1 -0
@@ -23,6 +23,7 @@#include <setjmp.h> #include <stdlib.h> #include <cmocka.h> +#include <stdio.h> #include "globals.c" #include "pgpolicies.h"
tests/uevent.c +4 -4
@@ -194,7 +194,7 @@ static void test_dm_name_good(void **state)char *name =uevent_get_dm_name (uev);assert_string_equal (name,DM_NAME ); -FREE (name); +free (name); }static void test_dm_name_bad_0 (void **state)
@@ -205,7 +205,7 @@ static void test_dm_name_bad_0(void **state) uev->envp[3 ] ="DM_NAME" DM_NAME ; name =uevent_get_dm_name (uev);assert_ptr_equal (name,NULL ); -FREE (name); +free (name); }static void test_dm_name_bad_1 (void **state)
@@ -216,7 +216,7 @@ static void test_dm_name_bad_1(void **state) uev->envp[3 ] ="DM_NAMES=" DM_NAME ; name =uevent_get_dm_name (uev);assert_ptr_equal (name,NULL ); -FREE (name); +free (name); }static void test_dm_name_good_1 (void **state)
@@ -228,7 +228,7 @@ static void test_dm_name_good_1(void **state) uev->envp[2 ] ="DM_NAME=" DM_NAME ; name =uevent_get_dm_name (uev);assert_string_equal (name,DM_NAME ); -FREE (name); +free (name); }static void test_dm_uuid_false_0 (void **state)
Signature · 4 lines
-- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 52 lines · lixiaokeng
Now there are tools such as valgrind and asan to detect memory leaks, so it is unnecessary to use _DEBUG_. Remove _DEBUG_ code.
Signed-off-by Lixiaokeng<[email protected]>---
libmpathpersist/mpath_persist.c | 4 +- libmpathpersist/mpath_updatepr.c | 1 - libmultipath/Makefile | 2 +- libmultipath/alias.c | 2 +- libmultipath/blacklist.c | 27 +- libmultipath/checkers.c | 4 +- libmultipath/checkers.h | 4 +- libmultipath/checkers/emc_clariion.c | 3 +- libmultipath/config.c | 85 +++-- libmultipath/configure.c | 21 +- libmultipath/defaults.c | 1 - libmultipath/defaults.h | 1 + libmultipath/devmapper.c | 15 +- libmultipath/dict.c | 49 ++- libmultipath/discovery.c | 1 - libmultipath/dmparser.c | 47 ++- libmultipath/io_err_stat.c | 13 +- libmultipath/log.c | 22 +- libmultipath/log_pthread.c | 2 - libmultipath/memory.c | 444 --------------------- --
libmultipath/memory.h | 66 ---- libmultipath/parser.c | 25 +- libmultipath/pgpolicies.c | 5 +- libmultipath/prio.c | 4 +- libmultipath/prio.h | 1 -libmultipath/prioritizers/path_latency.c| 6 +-libmultipath/prioritizers/weightedpath.c| 1 - libmultipath/propsel.c | 11 +- libmultipath/structs.c | 51 ++- libmultipath/sysfs.c | 2 +- libmultipath/uevent.c | 13 +- libmultipath/util.c | 7 +- libmultipath/util.h | 1 + libmultipath/uxsock.c | 5 +- libmultipath/vector.c | 15 +-multipath/main.c | 19 +- multipathd/cli.c | 23 +- multipathd/cli.h | 2 +- multipathd/cli_handlers.c | 7 +- multipathd/main.c | 33 +- multipathd/uxclnt.c | 5 +- multipathd/uxlsnr.c | 17 +- multipathd/waiter.c | 5 +- tests/pgpolicy.c | 1 + tests/uevent.c | 8 +- 45 files changed, 268 insertions(+), 813 deletions(-)
Quoted 4 lines
delete mode 100644
libmultipath/memory.c
delete mode 100644libmultipath/memory.h
Nice work! I only found one minor glitch, see below.
I'd have been even happier if this had been based on Ben's and my recent work, but no problem; I'll rebase the other patches, as I need to re-send them anyway.
Quoted 15 lines
multipathd/main.c +0
-0r = 0;
multipathd/main.c +1
-1@@ -2800,7 +2799,7 @@ init_vecs (void) { struct vectors * vecs; - vecs = (struct vectors *)MALLOC(sizeof(struct vectors)); + vecs = (struct vectors *)calloc(1, sizeof(struct vectors)); if (!vecs) return NULL;
multipathd/main.c static void cleanup_vecs(void) · line 3015
Quoted 6 lines
multipathd/main.c +1
-1@@ -3012,7 +3011,7 @@ static void cleanup_vecs(void) cleanup_maps(gvecs); cleanup_paths(gvecs); pthread_mutex_destroy(&gvecs->lock.mutex); - FREE(gvecs); + free(gvecs); }
I'd feel better if we set gvecs = NULL here. It's not strictly necessary because we're in cleanup, but if we mess up something in the cleanup code path in the future, diagnosing that will be easier.
If you don't mind, I'll just add that statement here.
Thanks,
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 60 lines · lixiaokeng
Now there are tools such as valgrind and asan to detect memory leaks, so it is unnecessary to use _DEBUG_. Remove _DEBUG_ code.
Signed-off-by Lixiaokeng<[email protected]>---
libmpathpersist/mpath_persist.c | 4 +- libmpathpersist/mpath_updatepr.c | 1 - libmultipath/Makefile | 2 +- libmultipath/alias.c | 2 +- libmultipath/blacklist.c | 27 +- libmultipath/checkers.c | 4 +- libmultipath/checkers.h | 4 +- libmultipath/checkers/emc_clariion.c | 3 +- libmultipath/config.c | 85 +++-- libmultipath/configure.c | 21 +- libmultipath/defaults.c | 1 - libmultipath/defaults.h | 1 + libmultipath/devmapper.c | 15 +- libmultipath/dict.c | 49 ++- libmultipath/discovery.c | 1 - libmultipath/dmparser.c | 47 ++- libmultipath/io_err_stat.c | 13 +- libmultipath/log.c | 22 +- libmultipath/log_pthread.c | 2 -libmultipath/memory.c | 444 ----------------------- libmultipath/memory.h | 66 ---- libmultipath/parser.c | 25 +-libmultipath/pgpolicies.c | 5 +- libmultipath/prio.c | 4 +- libmultipath/prio.h | 1 -
libmultipath/prioritizers/path_latency.c| 6 +-libmultipath/prioritizers/weightedpath.c| 1 - libmultipath/propsel.c | 11 +- libmultipath/structs.c | 51 ++- libmultipath/sysfs.c | 2 +- libmultipath/uevent.c | 13 +- libmultipath/util.c | 7 +- libmultipath/util.h | 1 + libmultipath/uxsock.c | 5 +- libmultipath/vector.c | 15 +-multipath/main.c | 19 +- multipathd/cli.c | 23 +- multipathd/cli.h | 2 +- multipathd/cli_handlers.c | 7 +- multipathd/main.c | 33 +- multipathd/uxclnt.c | 5 +- multipathd/uxlsnr.c | 17 +- multipathd/waiter.c | 5 +- tests/pgpolicy.c | 1 + tests/uevent.c | 8 +- 45 files changed, 268 insertions(+), 813 deletions(-)delete mode 100644
libmultipath/memory.c
delete mode 100644libmultipath/memory.h}
libmultipath/io_err_stat.c +0
-0
libmultipath/io_err_stat.c line 25
Quoted 4 lines
libmultipath/io_err_stat.c +1
-0@@ -22,9 +22,9 @@ #include <errno.h> #include <sys/mman.h> #include <sys/select.h> +#include <stdio.h>
AFAICS, this #include is unnecessary.
I'll remove this, apply the change mentioned in my previous post, and push to the queue branch
(https://github.com/openSUSE/multipath-tools/tree/queue).
Regards
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel