[PVFS2-CVS] commit by neill in pvfs2/src/apps/admin: pvfs2-ls.c

CVS commit program cvs at parl.clemson.edu
Tue Mar 16 16:31:17 EST 2004


Update of /projects/cvsroot/pvfs2/src/apps/admin
In directory parlweb:/tmp/cvs-serv845/src/apps/admin

Modified Files:
	pvfs2-ls.c 
Log Message:
- make pvfs2-ls report symlink sizes


Index: pvfs2-ls.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-ls.c,v
diff -p -u -r1.39 -r1.40
--- pvfs2-ls.c	11 Mar 2004 22:19:20 -0000	1.39
+++ pvfs2-ls.c	16 Mar 2004 21:31:16 -0000	1.40
@@ -287,9 +287,16 @@ void print_entry_attr(
         inode = scratch_inode;
     }
 
-    size = (((attr->objtype == PVFS_TYPE_METAFILE) &&
-             (attr->mask & PVFS_ATTR_SYS_SIZE)) ?
-            (unsigned long)attr->size : 0);
+    if ((attr->objtype == PVFS_TYPE_METAFILE) &&
+        (attr->mask & PVFS_ATTR_SYS_SIZE))
+    {
+        size = attr->size;
+    }
+    else if ((attr->objtype == PVFS_TYPE_SYMLINK) &&
+             (attr->link_target))
+    {
+        size = (PVFS_size)strlen(attr->link_target);
+    }
 
     if (opts->list_human_readable)
     {



More information about the PVFS2-CVS mailing list