gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r13392 - gnunet-gtk/src


From: gnunet
Subject: [GNUnet-SVN] r13392 - gnunet-gtk/src
Date: Tue, 26 Oct 2010 14:56:00 +0200

Author: grothoff
Date: 2010-10-26 14:56:00 +0200 (Tue, 26 Oct 2010)
New Revision: 13392

Modified:
   gnunet-gtk/src/main_window_file_publish.c
Log:
always use 0 for dirsize

Modified: gnunet-gtk/src/main_window_file_publish.c
===================================================================
--- gnunet-gtk/src/main_window_file_publish.c   2010-10-26 12:54:02 UTC (rev 
13391)
+++ gnunet-gtk/src/main_window_file_publish.c   2010-10-26 12:56:00 UTC (rev 
13392)
@@ -218,15 +218,25 @@
   GtkTreeIter pos;
   char *file_size_fancy;
   const char *ss;
+  struct stat sbuf;
 
-  if (GNUNET_OK != 
-      GNUNET_DISK_file_size (filename,
-                            &file_size,
-                            GNUNET_YES))
+  if (0 != STAT (filename, &sbuf))
+    return;
+  if (S_ISDIR (sbuf.st_mode))
     {
-      GNUNET_break (0);
-      return;
+      file_size = 0;
     }
+  else
+    {
+      if (GNUNET_OK != 
+         GNUNET_DISK_file_size (filename,
+                                &file_size,
+                                GNUNET_YES))
+       {
+         GNUNET_break (0);
+         return;
+       }
+    }
   ts = GTK_TREE_STORE (gtk_builder_get_object (master_builder,
                                               
"GNUNET_GTK_file_sharing_publishing_tree_store"));
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]