]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/accounting/procacct: fix minor errors
authorzhang jiao <zhangjiao2@cmss.chinamobile.com>
Tue, 3 Dec 2024 02:05:50 +0000 (10:05 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 13 Jan 2025 04:20:59 +0000 (20:20 -0800)
The logfile option was documented but not working.  Add it and optimized
the while loop.

Link: https://lkml.kernel.org/r/20241203020550.3145-1-zhangjiao2@cmss.chinamobile.com
Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Reviewed-by: Dr. Thomas Orgis <thomas.orgis@uni-hamburg.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/accounting/procacct.c

index 90c4a37f53d9bd9d68e0e8a8e8a8d95c5ee9d5cd..e8dee05a626464ed36a9fff01c5844c0ae3052cb 100644 (file)
@@ -274,12 +274,11 @@ int main(int argc, char *argv[])
        int maskset = 0;
        char *logfile = NULL;
        int cfd = 0;
-       int forking = 0;
 
        struct msgtemplate msg;
 
-       while (!forking) {
-               c = getopt(argc, argv, "m:vr:");
+       while (1) {
+               c = getopt(argc, argv, "m:vr:w:");
                if (c < 0)
                        break;