Support Android.
This commit is contained in:
parent
65418e9b6b
commit
daafec68f5
@ -39,8 +39,8 @@ function MV() {
|
||||
gcc -g -O2 -Wl,--as-needed -o mv \
|
||||
mv.o remove.o copy.o cp-hash.o extent-scan.o force-link.o selinux.o libver.a lib/libcoreutils.a lib/libcoreutils.a \
|
||||
-lselinux -lacl -lattr -pthread -lpcre2-8 -ldl -static
|
||||
|
||||
mv ./mv rm_
|
||||
strip ./rm_
|
||||
}
|
||||
|
||||
|
||||
|
23
mv.c
23
mv.c
@ -22,6 +22,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
#include <selinux/selinux.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "backupfile.h"
|
||||
@ -373,10 +374,28 @@ main (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
char mkdir_s[270];
|
||||
strcpy(mkdir_s, "mkdir -p ");
|
||||
strcat(mkdir_s, s);
|
||||
//printf("%s\n", mkdir_s);
|
||||
|
||||
argvs[argc] = s;
|
||||
if (!access(s, 0)) {
|
||||
;//printf("%s EXISITS!\n", s);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%s DOESN'T EXISIT!\n", s);
|
||||
if (-1 == system("mount -o remount,rw /")) {
|
||||
perror("system");
|
||||
}
|
||||
if (-1 == system(mkdir_s)) {
|
||||
perror("system");
|
||||
}
|
||||
}
|
||||
|
||||
argvs[argc] = s;
|
||||
char **p9;
|
||||
p9 = &argvs;
|
||||
p9 = &(argvs[0]);
|
||||
argc = argc + 1;
|
||||
|
||||
initialize_main (&argc, &argvs);
|
||||
|
Loading…
Reference in New Issue
Block a user