Lines Matching refs:sh

64 	static share_t *sh = NULL;  in getshare()  local
73 if (sh == NULL) { in getshare()
74 sh = (share_t *)malloc(sizeof (*sh)); in getshare()
75 if (sh == NULL) in getshare()
84 sh->sh_path = strtok(p, w); in getshare()
85 if (sh->sh_path == NULL) in getshare()
87 sh->sh_res = strtok(NULL, w); in getshare()
88 if (sh->sh_res == NULL) in getshare()
90 sh->sh_fstype = strtok(NULL, w); in getshare()
91 if (sh->sh_fstype == NULL) in getshare()
93 sh->sh_opts = strtok(NULL, w); in getshare()
94 if (sh->sh_opts == NULL) in getshare()
96 sh->sh_descr = strtok(NULL, ""); in getshare()
97 if (sh->sh_descr == NULL) in getshare()
98 sh->sh_descr = ""; in getshare()
100 *shp = sh; in getshare()
105 sharedup(share_t *sh) in sharedup() argument
113 nsh->sh_path = strdup(sh->sh_path); in sharedup()
116 nsh->sh_res = strdup(sh->sh_res); in sharedup()
119 nsh->sh_fstype = strdup(sh->sh_fstype); in sharedup()
122 nsh->sh_opts = strdup(sh->sh_opts); in sharedup()
125 nsh->sh_descr = strdup(sh->sh_descr); in sharedup()
136 sharefree(share_t *sh) in sharefree() argument
138 if (sh == NULL) in sharefree()
140 if (sh->sh_path != NULL) in sharefree()
141 free(sh->sh_path); in sharefree()
142 if (sh->sh_res != NULL) in sharefree()
143 free(sh->sh_res); in sharefree()
144 if (sh->sh_fstype != NULL) in sharefree()
145 free(sh->sh_fstype); in sharefree()
146 if (sh->sh_opts != NULL) in sharefree()
147 free(sh->sh_opts); in sharefree()
148 if (sh->sh_descr != NULL) in sharefree()
149 free(sh->sh_descr); in sharefree()
150 free(sh); in sharefree()