Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fw32.git;a=commitdiff;h=3f122515a5ca2c6492f26f41862c715e51eab165

commit 3f122515a5ca2c6492f26f41862c715e51eab165
Author: James Buren <r...@frugalware.org>
Date:   Thu Nov 3 02:00:51 2011 -0500

fw32.c: add pacman_g2 function

diff --git a/fw32.c b/fw32.c
index 6065221..e8344f3 100644
--- a/fw32.c
+++ b/fw32.c
@@ -5,6 +5,7 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/mount.h>
+#include <sys/wait.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
@@ -207,6 +208,32 @@ umount_directory(const char *path)
}

static void
+pacman_g2(char **args1)
+{
+  pid_t id;
+  int status;
+
+  id = fork();
+
+  if(!id)
+  {
+    char *args2[] = { "--noconfirm", "--root", FW32_ROOT, "--config", 
FW32_CONFIG, 0 };
+
+    execv("/usr/bin/pacman-g2",args_merge("/usr/bin/pacman-g2",args2,args1));
+
+    _exit(EXIT_FAILURE);
+  }
+  else if(id == -1)
+    error("fork: %s\n",strerror(errno));
+
+  if(waitpid(id,&status,0) == -1)
+    error("waitpid: %s\n",strerror(errno));
+
+  if(!WIFEXITED(status) || WEXITSTATUS(status))
+    error("pacman-g2 failed to complete its operation.\n");
+}
+
+static void
mount_all(void)
{
const char **p;
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to