trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #647: [TRAFODION-2146] Use of CQD to set sc...
Date Mon, 08 Aug 2016 22:43:43 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/647#discussion_r73969758
  
    --- Diff: core/sqf/src/stfs/stfs_stub.cpp ---
    @@ -328,63 +332,69 @@ copySTFSLocation(int pv_instnum)
     {
     
       //Directory locations not specified 
    -  if ((STFS_stub::stfsDirsHDD_.numLocations <= 0) && (STFS_stub::overflowType_
== STFS_HDD)) {
    +  if ((STFS_stub::stfsDirsHDD_.numLocations <= 0) && (STFS_stub::overflowType_
== STFS_HDD)) 
         return;
    -  }
    -  if ((STFS_stub::stfsDirsSSD_.numLocations <= 0) && (STFS_stub::overflowType_
== STFS_SSD)) {
    +  
    +  if ((STFS_stub::stfsDirsSSD_.numLocations <= 0) && (STFS_stub::overflowType_
== STFS_SSD)) 
         return;
    -  }
    +  
     
     
    -  if(STFS_stub::overflowType_ == STFS_HDD) {
    -    copyLocationHelper(STFS_stub::stfsDirsHDD_, pv_instnum);
    -  }
    -  else if(STFS_stub::overflowType_ == STFS_SSD) {
    +  if(STFS_stub::overflowType_ == STFS_HDD) 
    +    copyLocationHelper(STFS_stub::stfsDirsHDD_, pv_instnum);  
    +  else if(STFS_stub::overflowType_ == STFS_SSD) 
         copyLocationHelper(STFS_stub::stfsDirsSSD_, pv_instnum);
    -  }
    +  
     
    -  if (STFS_stub::stfsLocation_[strlen(STFS_stub::stfsLocation_) - 1] != '/') {
    +  if (STFS_stub::stfsLocation_[strlen(STFS_stub::stfsLocation_) - 1] != '/') 
         strcat(STFS_stub::stfsLocation_, "/");
    -  }
    -
    +  
     }
     
    +/// \brief Sets the scratchdisks as specified in the CQD SCRATCH_DISKS 
    +///        and avoids looking at envvar
    +void STFS_set_scratch_dirs(char *pv_scratchloc) 
    +{
    +   memset(STFS_stub::scratchCQDLocationString_, 0, sizeof(STFS_stub::scratchCQDLocationString_));
    +  strcpy((char *)STFS_stub::scratchCQDLocationString_,pv_scratchloc);
    --- End diff --
    
    strncpy would be safer (notwithstanding that scratchCQDLocationString_ is almost 131072
bytes)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message