Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fw32.git;a=commitdiff;h=99bed785a9853e75ddc99459aa0419f5b002846b
commit 99bed785a9853e75ddc99459aa0419f5b002846b Author: James Buren <[email protected]> Date: Thu Nov 3 03:27:58 2011 -0500 fw32.c: move some commands to pacman_g2 function diff --git a/fw32.c b/fw32.c index 65115be..a5632a9 100644 --- a/fw32.c +++ b/fw32.c @@ -209,11 +209,42 @@ umount_directory(const char *path) } static void +mount_all(void) +{ + const char **p; + + p = FW32_DIRS; + + while(*p) + mount_directory(*p++); +} + +static void +umount_all(void) +{ + const char **p; + char path[PATH_MAX]; + + p = FW32_DIRS; + + while(*p) + { + snprintf(path,sizeof path,"%s%s",FW32_ROOT,*p++); + + umount_directory(path); + } +} + +static void pacman_g2(char **args1) { pid_t id; int status; + umount_all(); + + mount_directory("/var/cache/pacman-g2/pkg"); + id = fork(); if(!id) @@ -232,33 +263,10 @@ pacman_g2(char **args1) if(!WIFEXITED(status) || WEXITSTATUS(status)) error("pacman-g2 failed to complete its operation.\n"); -} -static void -mount_all(void) -{ - const char **p; - - p = FW32_DIRS; - - while(*p) - mount_directory(*p++); -} - -static void -umount_all(void) -{ - const char **p; - char path[PATH_MAX]; - - p = FW32_DIRS; - - while(*p) - { - snprintf(path,sizeof path,"%s%s",FW32_ROOT,*p++); + umount_directory("/var/cache/pacman-g2/pkg"); - umount_directory(path); - } + mount_all(); } static void @@ -300,13 +308,7 @@ fw32_create(void) mkdir_parents(path); } - mount_directory("/var/cache/pacman-g2/pkg"); - pacman_g2(args); - - umount_directory("/var/cache/pacman-g2/pkg"); - - mount_all(); } static void _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
