Just to add more context:

the '-f' flag was apparently added upstream in commit
aa6873b85b09a3ea292afc7bfd535c382b57d905:

  
http://git.savannah.nongnu.org/cgit/sysvinit.git/commit/?id=aa6873b85b09a3ea292afc7bfd535c382b57d905

to solve Debian#571590 (whishlist). The easiest way out is to just
revert the commit above if upstream wants to keep the flag. Patch
attached.

HND

KatolaZ



Author: Vincenzo (KatolaZ) Nicosia
Closes: #924957
Date: Tue 19 Mar 2019 07:02:29 AM GMT


--- a/man/pidof.8
+++ b/man/pidof.8
@@ -28,8 +28,6 @@
 .IR omitpid[,omitpid...] ]
 .RB [ \-o
 .IR omitpid[,omitpid...]... ]
-.RB [ \-f
-.IR format ]
 .B program
 .RB [ program... ]
 .SH DESCRIPTION
@@ -68,9 +66,6 @@
 Tells \fIpidof\fP to omit processes with that process id. The special
 pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
 program, in other words the calling shell or shell script.
-.IP "-f \fIformat\fP"
-Tells \fIpidof\fP to format the process ids in the given \fIprintf\fP style.
-For example \fB" -p%d"\fP is useful for \fIstrace\fP.
 .SH "EXIT STATUS"
 .TP
 .B 0
--- a/src/killall5.c
+++ b/src/killall5.c
@@ -947,7 +947,6 @@
    printf("pidof usage: [options] <program-name>\n\n");
    printf(" -c           Return PIDs with the same root directory\n");
    printf(" -h           Display this help text\n");
-   printf(" -f <format>  Display PIDs in a given printf-style format\n");
    printf(" -n           Avoid using stat system function on network shares\n");
    printf(" -o <pid>     Omit results with a given PID\n");
    printf(" -q           Quiet mode. Do not display output\n");
@@ -997,7 +996,6 @@
 	int		chroot_check = 0;
 	struct stat	st;
 	char		tmp[512];
-        char            *format = NULL;
 
 	omit = (OMIT*)0;
 	nlist = (NFS*)0;
@@ -1006,7 +1004,7 @@
 	if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0))
 		flags |= PIDOF_NETFS;
 
-	while ((opt = getopt(argc,argv,"qhco:f:sxn")) != EOF) switch (opt) {
+	while ((opt = getopt(argc,argv,"qhco:sxn")) != EOF) switch (opt) {
 		case '?':
 			nsyslog(LOG_ERR,"invalid options on command line!\n");
 			closelog();
@@ -1017,9 +1015,6 @@
                 case 'h':
                         pidof_usage();
                         exit(0);
-                case 'f':
-                        format = optarg;
-                        break;
 		case 'o':
 			here = optarg;
 			while ((token = strsep(&here, ",;:"))) {
@@ -1116,14 +1111,9 @@
 				}
 
 				if ( ~flags & PIDOF_QUIET ) {
-                                    if (format)
-                                       printf(format, p->pid);
-                                    else
-                                    {
 					if (! first)
 						printf(" ");
 					printf("%d", p->pid);
-                                    }
 				}
 				first = 0;
 			}

Attachment: signature.asc
Description: PGP signature

Reply via email to