make_pidfile_name(const char *name)
{
if (name && strchr(name, ':')) {
- return strdup(name);
+ return xstrdup(name);
} else {
return xasprintf("%s/%s.pid", ovs_rundir(), program_name);
}
if (!strchr(suffix, ':')) {
path = xasprintf("%s/%s", ovs_rundir(), suffix);
} else {
- path = strdup(suffix);
+ path = xstrdup(suffix);
}
file = fopen(path, "r");
if (!strchr(suffix, ':')) {
path = xasprintf("%s/%s", ovs_rundir(), suffix);
} else {
- path = strdup(suffix);
+ path = xstrdup(suffix);
}
error = new_pstream(suffix_new, pstreamp, dscp, path, false);
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#ifndef _WIN32
abs_path = abs_file_name(ovs_rundir(), path);
#else
- abs_path = strdup(path);
+ abs_path = xstrdup(path);
#endif
punix_path = xasprintf("punix:%s", abs_path);
free(abs_path);
int error;
#ifdef _WIN32
- abs_path = strdup(path);
+ abs_path = xstrdup(path);
#else
abs_path = abs_file_name(ovs_rundir(), path);
#endif
vlog_set_levels_from_string_assert("odp_util:console:dbg");
if (filter_parse && !strncmp(filter_parse, "filter=", 7)) {
- filter = strdup(filter_parse+7);
+ filter = xstrdup(filter_parse + 7);
memset(&flow_filter, 0, sizeof(flow_filter));
memset(&wc_filter, 0, sizeof(wc_filter));
check_errno(int a, int b, const char *as, const char *file, int line)
{
if (a != b) {
- char *str_b = strdup(ovs_strerror(abs(b)));
+ char *str_b = xstrdup(ovs_strerror(abs(b)));
ovs_fatal(0, "%s:%d: %s is %d (%s) but should be %d (%s)",
file, line, as, a, ovs_strerror(abs(a)), b, str_b);
}