From 941dcc37d7520853f595bb2f370c0484a5e6d5f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1=D1?=
 =?UTF-8?q?=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
Date: Tue, 20 Mar 2012 01:00:44 +0400
Subject: [PATCH] Use GNUNET_DISK_file_size() to get size

---
 src/fs/gnunet-fs-gtk_publish-dialog.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c
index 0460e65..b5cb74f 100644
--- a/src/fs/gnunet-fs-gtk_publish-dialog.c
+++ b/src/fs/gnunet-fs-gtk_publish-dialog.c
@@ -1012,6 +1012,7 @@ add_item (struct AddDirClientContext *adcc,
   GtkTreeRowReference *row_reference;
   GtkTreePath *path;
   struct stat sbuf;
+  uint64_t fsize;
   
   if (0 != stat (item->filename,
 		 &sbuf))
@@ -1019,6 +1020,10 @@ add_item (struct AddDirClientContext *adcc,
     GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "stat", item->filename);
     return;
   }
+
+  if ((item->is_directory != GNUNET_YES) && (GNUNET_OK !=
+      GNUNET_DISK_file_size (item->filename, &fsize, GNUNET_YES, GNUNET_YES)))
+    return;
   gtk_tree_store_insert_after (ts, item_iter, parent, sibling);
   path = gtk_tree_model_get_path (GTK_TREE_MODEL (ts), item_iter);
   row_reference = gtk_tree_row_reference_new (GTK_TREE_MODEL (ts), path);
@@ -1050,7 +1055,7 @@ add_item (struct AddDirClientContext *adcc,
 						      item->meta, 
 						      adcc->directory_scan_do_index,
 						      &adcc->directory_scan_bo);
-    file_size_fancy = GNUNET_STRINGS_byte_size_fancy (sbuf.st_size);
+    file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize);
   }
   gtk_tree_store_set (ts, item_iter, 
 		      0, file_size_fancy,
-- 
1.7.4

