On Wed, Aug 02, 2017 at 09:56:50AM +0200, Martin Pieuchot wrote:
> Simple diff to improved readability.  Before:

There are situations where you want a full match on the command.
For testing and scripting with long program names this is necessary.
With a -v switch that shows the long name I would accept the patch.
netstat has that, too.  And it would help in my use case.

But note that connected sockets don't fit anyway.
_ntp     ntpd       19037    6* internet dgram udp 10.188.2.17:22899 <-> 
213.209.109.45:123

bluhm

> 
> $ fstat -f /tmp
> USER     CMD          PID   FD MOUNT        INUM MODE         R/W    SZ|DV
> mpi      fstat      96479    1 /tmp           19  -rw-r--r--     w        0
> mpi      ksh        46657    1 /tmp           19  -rw-r--r--     w        0
> mpi      gnome-terminal-s 59648   16 /tmp           24* -rw-------    rw   
> 262144
> mpi      gnome-terminal-s 59648   20 /tmp           25* -rw-------    rw   
> 131072
> mpi      python3.6  77178    3 /tmp           18* -rw-------   rwe     4096
> mpi      seahorse-sharing 21270   wd /tmp            2  drwxrwxrwt     r     
> 1024
> mpi      gnome-shell 26656   19 /tmp           12* -rw-------   rwe    12288
> 
> 
> After:
> 
> $ fstat -f /tmp
> USER     CMD            PID   FD MOUNT         INUM MODE         R/W    SZ|DV
> mpi      fstat        25800    1 /tmp           21  -rw-r--r--     w        0
> mpi      ksh          46657    1 /tmp           21  -rw-r--r--     w        0
> mpi      gnome-termin 59648   16 /tmp           24* -rw-------    rw   262144
> mpi      gnome-termin 59648   20 /tmp           25* -rw-------    rw   131072
> mpi      python3.6    77178    3 /tmp           18* -rw-------   rwe     4096
> mpi      seahorse-sha 21270   wd /tmp            2  drwxrwxrwt     r     1024
> mpi      gnome-shell  26656   19 /tmp           12* -rw-------   rwe    12288
> 
> 
> 
> ok?
> 
> Index: fstat.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/fstat/fstat.c,v
> retrieving revision 1.90
> diff -u -p -r1.90 fstat.c
> --- fstat.c   21 Jan 2017 12:21:57 -0000      1.90
> +++ fstat.c   2 Aug 2017 07:54:17 -0000
> @@ -318,10 +318,10 @@ fstat_header(void)
>  {
>       if (nflg)
>               printf("%s",
> -"USER     CMD          PID   FD  DEV      INUM       MODE   R/W    SZ|DV");
> +"USER     CMD            PID   FD  DEV       INUM       MODE   R/W    
> SZ|DV");
>       else
>               printf("%s",
> -"USER     CMD          PID   FD MOUNT        INUM MODE         R/W    
> SZ|DV");
> +"USER     CMD            PID   FD MOUNT         INUM MODE         R/W    
> SZ|DV");
>       if (oflg)
>               printf("%s", ":OFFSET  ");
>       if (checkfile && fsflg == 0)
> @@ -336,7 +336,7 @@ uid_t     *procuid;
>  pid_t        Pid;
>  
>  #define PREFIX(i) do { \
> -     printf("%-8.8s %-10s %5ld", Uname, Comm, (long)Pid); \
> +     printf("%-8.8s %-12.12s %5ld", Uname, Comm, (long)Pid); \
>       switch (i) { \
>       case KERN_FILE_TEXT: \
>               printf(" text"); \

Reply via email to