From: Thomas Veerman Date: Mon, 19 Jul 2010 13:57:47 +0000 (+0000) Subject: Teach DESCRIBE and fsck about UNIX Domain Sockets. Contributed by Thomas Cort X-Git-Tag: v3.1.8~193 X-Git-Url: http://zhaoyanbai.com/repos/%22../static/icons/man.3.ps?a=commitdiff_plain;h=103dc9e80a8e09dd7b27a749266a4007f6550e48;p=minix.git Teach DESCRIBE and fsck about UNIX Domain Sockets. Contributed by Thomas Cort --- diff --git a/commands/DESCRIBE/DESCRIBE.sh b/commands/DESCRIBE/DESCRIBE.sh index 93b1be347..ac98174fc 100644 --- a/commands/DESCRIBE/DESCRIBE.sh +++ b/commands/DESCRIBE/DESCRIBE.sh @@ -193,6 +193,9 @@ do 17,0) des="hello" dev=hello ;; + 18,0) + des="UNIX domain socket" dev=uds + ;; BAD,BAD) des= dev= ;; diff --git a/commands/fsck/fsck.c b/commands/fsck/fsck.c index fbe469a53..f2eccc536 100644 --- a/commands/fsck/fsck.c +++ b/commands/fsck/fsck.c @@ -143,7 +143,7 @@ int dev; /* file descriptor of the device */ /* Counters for each type of inode/zone. */ int nfreeinode, nregular, ndirectory, nblkspec, ncharspec, nbadinode; -int npipe, nsyml, ztype[NLEVEL]; +int nsock, npipe, nsyml, ztype[NLEVEL]; long nfreezone; int repair, automatic, listing, listsuper; /* flags */ @@ -221,7 +221,8 @@ void initvars() { register level; - nregular = ndirectory = nblkspec = ncharspec = nbadinode = npipe = nsyml = 0; + nregular = ndirectory = nblkspec = ncharspec = + nbadinode = nsock = npipe = nsyml = 0; for (level = 0; level < NLEVEL; level++) ztype[level] = 0; changed = 0; thisblk = NO_BLOCK; @@ -915,6 +916,7 @@ void list(ino_t ino, d_inode *ip) case I_CHAR_SPECIAL: putchar('c'); break; case I_BLOCK_SPECIAL: putchar('b'); break; case I_NAMED_PIPE: putchar('p'); break; + case I_UNIX_SOCKET: putchar('s'); break; #ifdef I_SYMBOLIC_LINK case I_SYMBOLIC_LINK: putchar('l'); break; #endif @@ -1372,6 +1374,9 @@ int chkmode(ino_t ino, d_inode *ip) case I_NAMED_PIPE: npipe++; return chkfile(ino, ip); + case I_UNIX_SOCKET: + nsock++; + return chkfile(ino, ip); #ifdef I_SYMBOLIC_LINK case I_SYMBOLIC_LINK: nsyml++; @@ -1476,6 +1481,7 @@ void printtotal() if (nbadinode != 0) pr("%6u Bad inode%s\n", nbadinode, "", "s"); pr("%8u Free inode%s\n", nfreeinode, "", "s"); pr("%8u Named pipe%s\n", npipe, "", "s"); + pr("%8u Unix socket%s\n", nsock, "", "s"); pr("%8u Symbolic link%s\n", nsyml, "", "s"); /* Don't print some fields. printf("\n");