2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

util: New functions get_cwd(), abs_file_name().

These will be used further in an upcoming commit.
This commit is contained in:
Ben Pfaff
2010-03-16 15:06:11 -07:00
parent 76f105d9be
commit daf03c53ee
5 changed files with 70 additions and 13 deletions

View File

@@ -58,9 +58,9 @@ static bool monitor;
char *
make_pidfile_name(const char *name)
{
return (!name ? xasprintf("%s/%s.pid", ovs_rundir, program_name)
: *name == '/' ? xstrdup(name)
: xasprintf("%s/%s", ovs_rundir, name));
return (!name
? xasprintf("%s/%s.pid", ovs_rundir, program_name)
: abs_file_name(ovs_rundir, name));
}
/* Sets up a following call to daemonize() to create a pidfile named 'name'.