summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRom Lemarchand <romlem@google.com>2013-01-28 23:23:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-01-28 23:23:40 +0000
commite74313baf8c2df0525f8a9a72a511b294ef632be (patch)
tree6492cc8e47d807859b80472e6a71dcc333ac5bb9
parent45509f9fdde8fafaf66f8583c3255aafcbeaf529 (diff)
parent611f5b4b938f2ffcf2a2e71a847e4fd12587ca4b (diff)
downloadsystem_core-e74313baf8c2df0525f8a9a72a511b294ef632be.zip
system_core-e74313baf8c2df0525f8a9a72a511b294ef632be.tar.gz
system_core-e74313baf8c2df0525f8a9a72a511b294ef632be.tar.bz2
Merge "logwrap: fix off by 1 argument error"
-rw-r--r--logwrapper/logwrap.c4
-rw-r--r--logwrapper/logwrapper.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/logwrapper/logwrap.c b/logwrapper/logwrap.c
index 9cd3fe4..09f8b81 100644
--- a/logwrapper/logwrap.c
+++ b/logwrapper/logwrap.c
@@ -227,7 +227,7 @@ int logwrap(int argc, char* argv[], int *status) {
dup2(child_ptty, 2);
close(child_ptty);
- child(argc - 1, &argv[1]);
+ child(argc, argv);
fatal("This should never happen\n");
return -1;
} else {
@@ -268,7 +268,7 @@ int logwrap(int argc, char* argv[], int *status) {
setgid(AID_LOG);
setuid(AID_LOG);
- rc = parent(argv[1], parent_ptty, sockets[1], pid, status);
+ rc = parent(argv[0], parent_ptty, sockets[1], pid, status);
}
close(sockets[0]);
diff --git a/logwrapper/logwrapper.c b/logwrapper/logwrapper.c
index 4f1bff9..e647b4d 100644
--- a/logwrapper/logwrapper.c
+++ b/logwrapper/logwrapper.c
@@ -59,7 +59,7 @@ int main(int argc, char* argv[]) {
usage();
}
- rc = logwrap(argc, argv, &status);
+ rc = logwrap(argc - 1, &argv[1], &status);
if (!rc) {
if (WIFEXITED(status))
rc = WEXITSTATUS(status);