Mercurial > public > mercurial-scm > hg
diff contrib/chg/chg.c @ 30677:c80c16a8a0b0
chg: support long socket path
This patch replaces UNIX_PATH_MAX (108) with PATH_MAX (4096) so we can have
long unix path.
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 23 Dec 2016 16:26:40 +0000 |
parents | b83bddfc8048 |
children | 4677df6b449a |
line wrap: on
line diff
--- a/contrib/chg/chg.c Fri Dec 23 16:16:44 2016 +0000 +++ b/contrib/chg/chg.c Fri Dec 23 16:26:40 2016 +0000 @@ -25,14 +25,14 @@ #include "hgclient.h" #include "util.h" -#ifndef UNIX_PATH_MAX -#define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)NULL)->sun_path)) +#ifndef PATH_MAX +#define PATH_MAX 4096 #endif struct cmdserveropts { - char sockname[UNIX_PATH_MAX]; - char initsockname[UNIX_PATH_MAX]; - char redirectsockname[UNIX_PATH_MAX]; + char sockname[PATH_MAX]; + char initsockname[PATH_MAX]; + char redirectsockname[PATH_MAX]; size_t argsize; const char **args; }; @@ -130,7 +130,7 @@ static void setcmdserveropts(struct cmdserveropts *opts) { int r; - char sockdir[UNIX_PATH_MAX]; + char sockdir[PATH_MAX]; const char *envsockname = getenv("CHGSOCKNAME"); if (!envsockname) { /* by default, put socket file in secure directory