##// END OF EJS Templates
chg: support long socket path...
Jun Wu -
r30677:c80c16a8 default
parent child Browse files
Show More
@@ -25,14 +25,14 b''
25 #include "hgclient.h"
25 #include "hgclient.h"
26 #include "util.h"
26 #include "util.h"
27
27
28 #ifndef UNIX_PATH_MAX
28 #ifndef PATH_MAX
29 #define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)NULL)->sun_path))
29 #define PATH_MAX 4096
30 #endif
30 #endif
31
31
32 struct cmdserveropts {
32 struct cmdserveropts {
33 char sockname[UNIX_PATH_MAX];
33 char sockname[PATH_MAX];
34 char initsockname[UNIX_PATH_MAX];
34 char initsockname[PATH_MAX];
35 char redirectsockname[UNIX_PATH_MAX];
35 char redirectsockname[PATH_MAX];
36 size_t argsize;
36 size_t argsize;
37 const char **args;
37 const char **args;
38 };
38 };
@@ -130,7 +130,7 b' static void preparesockdir(const char *s'
130 static void setcmdserveropts(struct cmdserveropts *opts)
130 static void setcmdserveropts(struct cmdserveropts *opts)
131 {
131 {
132 int r;
132 int r;
133 char sockdir[UNIX_PATH_MAX];
133 char sockdir[PATH_MAX];
134 const char *envsockname = getenv("CHGSOCKNAME");
134 const char *envsockname = getenv("CHGSOCKNAME");
135 if (!envsockname) {
135 if (!envsockname) {
136 /* by default, put socket file in secure directory
136 /* by default, put socket file in secure directory
@@ -16,6 +16,20 b' ill-formed config'
16 [255]
16 [255]
17
17
18 $ cp $HGRCPATH.orig $HGRCPATH
18 $ cp $HGRCPATH.orig $HGRCPATH
19
20 long socket path
21
22 $ sockpath=$TESTTMP/this/path/should/be/longer/than/one-hundred-and-seven/characters/where/107/is/the/typical/size/limit/of/unix-domain-socket
23 $ mkdir -p $sockpath
24 $ bakchgsockname=$CHGSOCKNAME
25 $ CHGSOCKNAME=$sockpath/server
26 $ export CHGSOCKNAME
27 $ chg root
28 $TESTTMP/foo
29 $ rm -rf $sockpath
30 $ CHGSOCKNAME=$bakchgsockname
31 $ export CHGSOCKNAME
32
19 $ cd ..
33 $ cd ..
20
34
21 server lifecycle
35 server lifecycle
General Comments 0
You need to be logged in to leave comments. Login now