Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_file


Modified Files:
        ecore_file.c 


Log Message:


return 0 if file cp only partially succeeded

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- ecore_file.c        25 Mar 2007 12:05:48 -0000      1.58
+++ ecore_file.c        22 Apr 2007 23:07:48 -0000      1.59
@@ -183,6 +183,7 @@
    char                realpath1[PATH_MAX];
    char                realpath2[PATH_MAX];
    size_t              num;
+   int                 ret = 1;
 
    if (!realpath(src, realpath1)) return 0;
    if (realpath(dst, realpath2) && !strcmp(realpath1, realpath2)) return 0;
@@ -195,10 +196,13 @@
        fclose(f1);
        return 0;
      }
-   while ((num = fread(buf, 1, sizeof(buf), f1)) > 0) fwrite(buf, 1, num, f2);
+   while ((num = fread(buf, 1, sizeof(buf), f1)) > 0)
+     {
+       if (fwrite(buf, 1, num, f2) != num) ret = 0;
+     }
    fclose(f1);
    fclose(f2);
-   return 1;
+   return ret;
 }
 
 EAPI int



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to