[cig-commits] [commit] pluggable: Fixed bugs: SIGSEGV caused by bogo proto; trim whitespace from LOCAL_PATH; bad permissions on local copy of broadcasted "model.tgz". (3a94f3e)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Apr 9 08:54:48 PDT 2014


Repository : ssh://geoshell/specfem3d_globe

On branch  : pluggable
Link       : https://github.com/geodynamics/specfem3d_globe/compare/64e1b38f0c5ebb4056cce0b15d41c0b9f94ab6e5...099a4d330d5b173b21e51ad441f9f429e5d37842

>---------------------------------------------------------------

commit 3a94f3edb87d1bab2e5cabc0defa7e3a0c5496fe
Author: Leif Strand <leif at geodynamics.org>
Date:   Tue Nov 25 01:34:58 2008 +0000

    Fixed bugs: SIGSEGV caused by bogo proto; trim whitespace from
    LOCAL_PATH; bad permissions on local copy of broadcasted "model.tgz".


>---------------------------------------------------------------

3a94f3edb87d1bab2e5cabc0defa7e3a0c5496fe
 bcast_model.c | 6 +++---
 meshfem3D.f90 | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bcast_model.c b/bcast_model.c
index 001b07a..1eb056b 100644
--- a/bcast_model.c
+++ b/bcast_model.c
@@ -16,7 +16,7 @@
 static char wd[150], modelDir[150];
 
 
-void FC_FUNC_(bcast_model, BCAST_MODEL)(int *pRank, char *scratchDir, int *scratchDirLen) {
+void FC_FUNC_(bcast_model, BCAST_MODEL)(int *pRank, char *scratchDir, int scratchDirLen) {
     int fd, rank;
     struct stat statBuf;
     int size;
@@ -70,7 +70,7 @@ void FC_FUNC_(bcast_model, BCAST_MODEL)(int *pRank, char *scratchDir, int *scrat
     }
     
     /* Create and enter the model directory. */
-    sprintf(modelDir, "%.*s/model-%d", *scratchDirLen, scratchDir, rank);
+    sprintf(modelDir, "%.*s/model-%d", scratchDirLen, scratchDir, rank);
     if (mkdir(modelDir, 0777) == -1) {
         perror("mkdir");
         MPI_Abort(MPI_COMM_WORLD, 1);
@@ -81,7 +81,7 @@ void FC_FUNC_(bcast_model, BCAST_MODEL)(int *pRank, char *scratchDir, int *scrat
     }
     
     /* Save a local copy of the model archive. */
-    fd = open("model.tgz", O_CREAT | O_WRONLY);
+    fd = open("model.tgz", O_CREAT | O_WRONLY, S_IRUSR);
     if (fd == -1) {
         perror("open");
         MPI_Abort(MPI_COMM_WORLD, 1);
diff --git a/meshfem3D.f90 b/meshfem3D.f90
index 30318fb..c2d8f86 100644
--- a/meshfem3D.f90
+++ b/meshfem3D.f90
@@ -857,7 +857,7 @@
   endif
   if(ELLIPTICITY) call make_ellipticity(nspl,rspl,espl,espl2,ONE_CRUST)
 
-  call bcast_model(myrank, LOCAL_PATH)
+  call bcast_model(myrank, trim(LOCAL_PATH))
 
   call read_3d_mantle_model()
 



More information about the CIG-COMMITS mailing list