From 725b49dcb59d91cbf1f29ab74e7992748eb1df06 Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 11 Oct 2007 06:22:35 +0000 Subject: [PATCH] Do truncate files before writting into it (gras file sockets are streams, seeking into it to change only subparts is a non-sense) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4805 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/gras/Transport/transport_plugin_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gras/Transport/transport_plugin_file.c b/src/gras/Transport/transport_plugin_file.c index 9ad44a7dad..7b209682c8 100644 --- a/src/gras/Transport/transport_plugin_file.c +++ b/src/gras/Transport/transport_plugin_file.c @@ -84,7 +84,7 @@ gras_socket_client_from_file(const char*path) { res->plugin=gras_trp_plugin_get_by_name("file"); if (strcmp("-", path)) { - res->sd = open(path, O_WRONLY|O_CREAT | O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP ); + res->sd = open(path, O_TRUNC|O_WRONLY|O_CREAT | O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP ); if ( res->sd < 0) { THROW2(system_error,0, -- 2.20.1