Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e74313ba authored by Rom Lemarchand's avatar Rom Lemarchand Committed by Android (Google) Code Review
Browse files

Merge "logwrap: fix off by 1 argument error"

parents 45509f9f 611f5b4b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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]);
+1 −1
Original line number Diff line number Diff line
@@ -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);