lsof: print fd# too

function                                             old     new   delta
lsof_main                                            179     188      +9
.rodata                                           103194  103187      -7

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2021-06-16 12:49:15 +02:00
parent 1abaa6b84c
commit 57be5daa40

View File

@ -66,7 +66,7 @@ int lsof_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
safe_strncpy(name + baseofs, entry->d_name, 10); safe_strncpy(name + baseofs, entry->d_name, 10);
if ((fdlink = xmalloc_readlink(name)) != NULL) { if ((fdlink = xmalloc_readlink(name)) != NULL) {
printf("%d\t%s\t%s\n", proc->pid, proc->exe, fdlink); printf("%d\t%s\t%s\t%s\n", proc->pid, proc->exe, entry->d_name, fdlink);
free(fdlink); free(fdlink);
} }
} }