Fix compile error on Linux

This commit is contained in:
Andrew Bettison 2013-02-22 12:06:21 +10:30
parent 7e206d5930
commit 5ac6bd8834
2 changed files with 4 additions and 4 deletions

View File

@ -714,9 +714,9 @@ int app_server_start(const struct cli_parsed *parsed, void *context)
#endif
if ((tmp = malloc(PATH_MAX)) == NULL)
RETURN(WHY("Out of memory"));
if (get_self_executable_path(tmp, PATH_MAX) == -1)
RETURN(WHY("unable to determine own executable name"));
execpath = tmp;
if (get_self_executable_path(tmp, PATH_MAX) == -1)
RETURN(WHY("unable to determine own executable name"));
execpath = tmp;
}
/* Create the instance directory if it does not yet exist */
if (create_serval_instance_dir() == -1)

View File

@ -88,7 +88,7 @@ int overlay_mdp_setup_sockets()
}
#endif
if (mdp_named.poll.fd<=0) {
if (!form_serval_instance_path(&name.sun_path[0], PATH_MAX, "mdp.socket"))
if (!form_serval_instance_path(&name.sun_path[0], sizeof name.sun_path, "mdp.socket"))
return WHY("Cannot construct name of unix domain socket.");
unlink(&name.sun_path[0]);
len = 0+strlen(&name.sun_path[0]) + sizeof(name.sun_family)+1;