PERFORCE change 145739 for review
Ed Schouten
ed at FreeBSD.org
Wed Jul 23 18:33:35 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=145739
Change 145739 by ed at ed_dull on 2008/07/23 18:33:12
Fix fstat -n on pseudo-terminal masters. We should display the
major/minor numbers of the corresponding device node.
Affected files ...
.. //depot/projects/mpsafetty/usr.bin/fstat/fstat.c#2 edit
Differences ...
==== //depot/projects/mpsafetty/usr.bin/fstat/fstat.c#2 (text+ko) ====
@@ -901,6 +901,7 @@
struct tty tty;
char *name;
char rw[3];
+ dev_t rdev;
PREFIX(i);
@@ -923,7 +924,15 @@
if (flag & FWRITE)
strcat(rw, "w");
- printf("* pseudo-terminal master %10s %2s\n", name, rw);
+ printf("* pseudo-terminal master ");
+ if (nflg || !name) {
+ rdev = dev2udev(tty.t_dev);
+ printf("%10d,%-2d", major(rdev), minor(rdev));
+ } else {
+ printf("%10s", name);
+ }
+ printf(" %2s\n", rw);
+
free(name);
return;
More information about the p4-projects
mailing list