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

CVS commit program cvs at parl.clemson.edu
Fri Jul 9 11:06:43 EDT 2004


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

Modified Files:
	pvfs2-cp.c 
Log Message:
- truncate target files if they already exist
  [ error pointed out by Philipp Sadleder ]


Index: pvfs2-cp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-cp.c,v
diff -p -u -r1.6 -r1.7
--- pvfs2-cp.c	8 Jul 2004 20:55:23 -0000	1.6
+++ pvfs2-cp.c	9 Jul 2004 14:06:43 -0000	1.7
@@ -144,7 +144,7 @@ int main (int argc, char ** argv)
 
     PVFS_util_gen_credentials(&credentials);
 
-    ret = generic_open(&src, &credentials, 0, NULL, OPEN_SRC );
+    ret = generic_open(&src, &credentials, 0, NULL, OPEN_SRC);
     if (ret < 0)
     {
 	fprintf(stderr, "Could not open %s\n", user_opts->srcfile);
@@ -448,7 +448,7 @@ static int generic_open(file_object *obj
 	    }
 
 	    obj->ufs.fd = open(obj->ufs.path,
-                               O_WRONLY|O_CREAT|O_LARGEFILE, 0666);
+                               O_WRONLY|O_CREAT|O_LARGEFILE|O_TRUNC,0666);
 	}
 	if (obj->ufs.fd < 0)
 	{



More information about the PVFS2-CVS mailing list