gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r8292 - GNUnet/src/applications/fs/fsui


From: gnunet
Subject: [GNUnet-SVN] r8292 - GNUnet/src/applications/fs/fsui
Date: Wed, 25 Feb 2009 20:44:47 -0700

Author: amatus
Date: 2009-02-25 20:44:47 -0700 (Wed, 25 Feb 2009)
New Revision: 8292

Modified:
   GNUnet/src/applications/fs/fsui/upload.c
Log:
Without this check it will assume inaccessable files are directories.


Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2009-02-25 13:11:43 UTC (rev 
8291)
+++ GNUnet/src/applications/fs/fsui/upload.c    2009-02-26 03:44:47 UTC (rev 
8292)
@@ -663,7 +663,16 @@
             struct GNUNET_FSUI_UploadList *parent)
 {
   GNUNET_FSUI_UploadList *utc;
+  int ret;
 
+  ret = GNUNET_disk_file_test (shared->ctx->ectx, filename);
+  if(GNUNET_SYSERR == ret)
+    {
+      GNUNET_GE_LOG (shared->ctx->ectx,
+                     GNUNET_GE_FATAL | GNUNET_GE_BULK | GNUNET_GE_USER,
+                     "Unable to access file: %s\n", filename);
+      return NULL;
+    }
   utc = GNUNET_malloc (sizeof (GNUNET_FSUI_UploadList));
   utc->completed = 0;
   utc->total = 0;               /* to be set later */
@@ -675,7 +684,7 @@
   utc->uri = NULL;
   utc->cctx = NULL;             /* to be set later */
   utc->state = GNUNET_FSUI_ACTIVE;
-  if (GNUNET_YES == GNUNET_disk_file_test (shared->ctx->ectx, filename))
+  if (GNUNET_YES == ret)
     {
       utc->is_directory = GNUNET_NO;
       /* add this file */





reply via email to

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