Lines Matching refs:oldns
101 char oldns[PATH_MAX]; in nsinfo__init() local
108 if (snprintf(oldns, PATH_MAX, "/proc/self/ns/mnt") >= PATH_MAX) in nsinfo__init()
114 if (stat(oldns, &old_stat) < 0) in nsinfo__init()
249 int oldns = -1; in nsinfo__mountns_enter() local
256 nc->oldns = -1; in nsinfo__mountns_enter()
269 oldns = open(curpath, O_RDONLY); in nsinfo__mountns_enter()
270 if (oldns < 0) in nsinfo__mountns_enter()
281 nc->oldns = oldns; in nsinfo__mountns_enter()
287 if (oldns > -1) in nsinfo__mountns_enter()
288 close(oldns); in nsinfo__mountns_enter()
295 if (nc == NULL || nc->oldns == -1 || nc->newns == -1 || !nc->oldcwd) in nsinfo__mountns_exit()
298 setns(nc->oldns, CLONE_NEWNS); in nsinfo__mountns_exit()
305 if (nc->oldns > -1) { in nsinfo__mountns_exit()
306 close(nc->oldns); in nsinfo__mountns_exit()
307 nc->oldns = -1; in nsinfo__mountns_exit()