Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fvbe.git;a=commitdiff;h=fc290a67c3be5f795cdd0300fc41cf2ca174f226
commit fc290a67c3be5f795cdd0300fc41cf2ca174f226 Author: James Buren <[email protected]> Date: Sat Sep 21 20:39:37 2013 -0500 utility: when calling umount_all(), sort the paths list in descending order. this make it no longer necessary to handle the root path as a special case. diff --git a/src/utility.c b/src/utility.c index 4ee7884..884aed2 100644 --- a/src/utility.c +++ b/src/utility.c @@ -542,8 +542,7 @@ extern void umount_all(void) i == size - 1 || strtok(line,SPACE_CHARS) == 0 || (path = strtok(0,SPACE_CHARS)) == 0 || - strncmp(path,g->guestroot,strlen(g->guestroot)) != 0 || - strcmp(path,g->guestroot) == 0 + strncmp(path,g->guestroot,strlen(g->guestroot)) != 0 ) continue; @@ -552,6 +551,8 @@ extern void umount_all(void) paths[i] = 0; + qsort(paths,i,sizeof(char *),dirs_descend_compare); + for( i = 0 ; paths[i] != 0 ; ++i ) { path = paths[i]; @@ -563,12 +564,6 @@ extern void umount_all(void) } } - if(umount2(g->guestroot,MNT_DETACH|UMOUNT_NOFOLLOW) == -1 && errno != ENOENT) - { - error(strerror(errno)); - goto bail; - } - bail: if(file != 0) _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
