Lines Matching refs:sh
58 static share_t *sh = NULL;
68 if (sh == NULL) {
69 sh = (share_t *)malloc(sizeof (*sh));
70 if (sh == NULL)
79 sh->sh_path = (char *)strtok_r(p, w, &lasts);
80 if (sh->sh_path == NULL)
82 sh->sh_res = (char *)strtok_r(NULL, w, &lasts);
83 if (sh->sh_res == NULL)
85 sh->sh_fstype = (char *)strtok_r(NULL, w, &lasts);
86 if (sh->sh_fstype == NULL)
88 sh->sh_opts = (char *)strtok_r(NULL, w, &lasts);
89 if (sh->sh_opts == NULL)
91 sh->sh_descr = (char *)strtok_r(NULL, "", &lasts);
92 if (sh->sh_descr == NULL)
93 sh->sh_descr = "";
95 *shp = sh;
100 sharedup(share_t *sh)
108 if (sh->sh_path) {
109 nsh->sh_path = strdup(sh->sh_path);
114 if (sh->sh_res) {
115 nsh->sh_res = strdup(sh->sh_res);
119 if (sh->sh_fstype) {
120 nsh->sh_fstype = strdup(sh->sh_fstype);
124 if (sh->sh_opts) {
125 nsh->sh_opts = strdup(sh->sh_opts);
129 if (sh->sh_descr) {
130 nsh->sh_descr = strdup(sh->sh_descr);
142 sharefree(share_t *sh)
144 if (sh->sh_path != NULL)
145 free(sh->sh_path);
146 if (sh->sh_res != NULL)
147 free(sh->sh_res);
148 if (sh->sh_fstype != NULL)
149 free(sh->sh_fstype);
150 if (sh->sh_opts != NULL)
151 free(sh->sh_opts);
152 if (sh->sh_descr != NULL)
153 free(sh->sh_descr);
154 free(sh);