Changeset 2289 for trunk/src/kash/shinstance.c
- Timestamp:
- Feb 26, 2009, 5:58:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/shinstance.c
r2287 r2289 80 80 81 81 82 typedef struct shmtxtmp { int i; } shmtxtmp;83 84 82 int shmtx_init(shmtx *pmtx) 85 83 { … … 160 158 } 161 159 #endif 160 161 /** 162 * Destroys the shell instance. 163 * 164 * This will work on partially initialized instances (because I'm lazy). 165 * 166 * @param psh The shell instance to be destroyed. 167 */ 168 static void sh_destroy(shinstance *psh) 169 { 170 memset(psh, 0, sizeof(*psh)); 171 free(psh); 172 } 162 173 163 174 /** … … 223 234 if (psh) 224 235 { 225 if (!sh_env_clone(&psh->shenviron, envp)) 236 /* Init it enought for sh_destroy() to not get upset */ 237 /* ... */ 238 239 /* Call the basic initializers. */ 240 if ( !sh_env_clone(&psh->shenviron, envp) 241 && !shfile_init(&psh->fdtab, inherit ? &inherit->fdtab : NULL)) 226 242 { 227 243 /* the special stuff. */ … … 282 298 } 283 299 284 free(psh);300 sh_destroy(psh); 285 301 } 286 302 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.