summaryrefslogtreecommitdiffstats
path: root/bmlutils/bmlutils.c
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-11-10 18:22:10 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-11-12 18:03:50 +0100
commitbcc502cff9fea2d892a0344879e420df1d10fb47 (patch)
tree05b239cbc41d72372343f4dbe78ee0674b3ee146 /bmlutils/bmlutils.c
parentupdate theme thanks to Alexey71 on xda. (diff)
downloadandroid_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.tar
android_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.tar.gz
android_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.tar.bz2
android_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.tar.lz
android_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.tar.xz
android_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.tar.zst
android_bootable_recovery-bcc502cff9fea2d892a0344879e420df1d10fb47.zip
Diffstat (limited to 'bmlutils/bmlutils.c')
-rw-r--r--bmlutils/bmlutils.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/bmlutils/bmlutils.c b/bmlutils/bmlutils.c
index d59475eba..4c7c49d03 100644
--- a/bmlutils/bmlutils.c
+++ b/bmlutils/bmlutils.c
@@ -22,50 +22,7 @@
#include <bmlutils.h>
-#undef _PATH_BSHELL
-#define _PATH_BSHELL "/sbin/sh"
-
-int __system(const char *command)
-{
- pid_t pid;
- sig_t intsave, quitsave;
- sigset_t mask, omask;
- int pstat;
- char *argp[] = {"sh", "-c", NULL, NULL};
-
- if (!command) /* just checking... */
- return(1);
-
- argp[2] = (char *)command;
-
- sigemptyset(&mask);
- sigaddset(&mask, SIGCHLD);
- sigprocmask(SIG_BLOCK, &mask, &omask);
- switch (pid = vfork()) {
- case -1: /* error */
- sigprocmask(SIG_SETMASK, &omask, NULL);
- return(-1);
- case 0: /* child */
- sigprocmask(SIG_SETMASK, &omask, NULL);
- execve(_PATH_BSHELL, argp, environ);
- _exit(127);
- }
-
- intsave = (sig_t) bsd_signal(SIGINT, SIG_IGN);
- quitsave = (sig_t) bsd_signal(SIGQUIT, SIG_IGN);
- pid = waitpid(pid, (int *)&pstat, 0);
- sigprocmask(SIG_SETMASK, &omask, NULL);
- (void)bsd_signal(SIGINT, intsave);
- (void)bsd_signal(SIGQUIT, quitsave);
- return (pid == -1 ? -1 : pstat);
-}
-
-static struct pid {
- struct pid *next;
- FILE *fp;
- pid_t pid;
-} *pidlist;
-
+#include "../libcrecovery/common.h"
static int restore_internal(const char* bml, const char* filename)
{