Skip to content

Commit 811dc78

Browse files
committed
Don't select the file descriptor field by default.
Close #103. The version 4.88 introduced the change for selecting the file descriptor field by default. However, the change is not suitable for users who wants to print only PID field. @po5857 suggests the use case and the way to improve the man page. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
1 parent 6515abe commit 811dc78

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

00CREDITS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,9 @@ provided test systems where I was able to do development work.
548548
@hardikpnsp (github account)
549549
Martin D Kealey
550550
Henry Peteet
551-
@zhrf2020 and
552-
@JustAnotherArchivist
551+
@zhrf2020
552+
@JustAnotherArchivist and
553+
@po5857
553554

554555
If I have omitted a contributor's name, the fault is wholly mine,
555556
and I apologize for the error.

00DIST

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5176,5 +5176,12 @@ July 14, 2018
51765176
This change closed #116.
51775177

51785178

5179+
Don't select the file descriptor field by default.
5180+
The version 4.88 introduced the change for selecting the file
5181+
descriptor field by default. However, the change is not
5182+
suitable for users who wants to print only PID field.
5183+
@po5857 suggests the use case and the way to improve the man page.
5184+
5185+
51795186
Masatake YAMATO <yamato@redhat.com>, a member of the lsof-org team at GitHub
51805187
October 4, 2020

Lsof.8

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3272,6 +3272,7 @@ ends each process and file set with a NL (012) character.
32723272
.PP
32733273
.I Lsof
32743274
always produces one field, the PID (`p') field.
3275+
In repeat mode, the marker (`m') is also produced.
32753276
All other fields may be declared optionally in the field identifier
32763277
character list that follows the
32773278
.B \-F
@@ -3283,6 +3284,15 @@ does not normally list \- e.g., PPID, selected with
32833284
specification of the field character \- e.g., ``\fB\-FR\fP'' \-
32843285
also selects the listing of the item.
32853286
.PP
3287+
.I Lsof
3288+
version from 4.88 to 4.93.2 always produced one more field,
3289+
the file descriptor (`f') field. However,
3290+
.I lsof
3291+
in this version doesn't produce it. This change is for supporting
3292+
the use case that a user needs only the PID field, and doesn't
3293+
need the file descriptor field. Specify `f' explicitly if you
3294+
need the field.
3295+
.PP
32863296
It is entirely possible to select a set of fields that cannot
32873297
easily be parsed \- e.g., if the field descriptor field is not
32883298
selected, it may be difficult to identify file sets.
@@ -3312,7 +3322,7 @@ The single character listed first is the field identifier.
33123322
C file structure share count
33133323
d file's device character code
33143324
D file's major/minor device number (0x<hexadecimal>)
3315-
f file descriptor (always selected)
3325+
f file descriptor
33163326
F file structure address (0x<hexadecimal>)
33173327
G file flaGs (0x<hexadecimal>; names if \fB+fg\fP follows)
33183328
g process group ID
@@ -3321,7 +3331,7 @@ The single character listed first is the field identifier.
33213331
k link count
33223332
l file's lock status
33233333
L process login name
3324-
m marker between repeated output
3334+
m marker between repeated output (always selected in repeat mode)
33253335
M the task comMand name
33263336
n file name, comment, Internet address
33273337
N node identifier (ox<hexadecimal>

store.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct fieldsel FieldSel[] = {
210210
{ LSOF_FID_CT, 0, LSOF_FNM_CT, &Fsv, FSV_CT }, /* 2 */
211211
{ LSOF_FID_DEVCH, 0, LSOF_FNM_DEVCH, NULL, 0 }, /* 3 */
212212
{ LSOF_FID_DEVN, 0, LSOF_FNM_DEVN, NULL, 0 }, /* 4 */
213-
{ LSOF_FID_FD, 1, LSOF_FNM_FD, NULL, 0 }, /* 5 */
213+
{ LSOF_FID_FD, 0, LSOF_FNM_FD, NULL, 0 }, /* 5 */
214214
{ LSOF_FID_FA, 0, LSOF_FNM_FA, &Fsv, FSV_FA }, /* 6 */
215215
{ LSOF_FID_FG, 0, LSOF_FNM_FG, &Fsv, FSV_FG }, /* 7 */
216216
{ LSOF_FID_INODE, 0, LSOF_FNM_INODE, NULL, 0 }, /* 8 */

0 commit comments

Comments
 (0)