##// END OF EJS Templates
chg: add sockdirfd to cmdserveropts...
Jun Wu -
r28852:7b5f5a1b default
parent child Browse files
Show More
@@ -36,17 +36,23 b' struct cmdserveropts {'
36 size_t argsize;
36 size_t argsize;
37 const char **args;
37 const char **args;
38 int lockfd;
38 int lockfd;
39 int sockdirfd;
39 };
40 };
40
41
41 static void initcmdserveropts(struct cmdserveropts *opts) {
42 static void initcmdserveropts(struct cmdserveropts *opts) {
42 memset(opts, 0, sizeof(struct cmdserveropts));
43 memset(opts, 0, sizeof(struct cmdserveropts));
43 opts->lockfd = -1;
44 opts->lockfd = -1;
45 opts->sockdirfd = AT_FDCWD;
44 }
46 }
45
47
46 static void freecmdserveropts(struct cmdserveropts *opts) {
48 static void freecmdserveropts(struct cmdserveropts *opts) {
47 free(opts->args);
49 free(opts->args);
48 opts->args = NULL;
50 opts->args = NULL;
49 opts->argsize = 0;
51 opts->argsize = 0;
52 if (opts->sockdirfd != AT_FDCWD) {
53 close(opts->sockdirfd);
54 opts->sockdirfd = AT_FDCWD;
55 }
50 }
56 }
51
57
52 /*
58 /*
General Comments 0
You need to be logged in to leave comments. Login now