diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 30ec4de..79266e9 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -1,15 +1,17 @@ name: clang-format Check on: pull_request: + jobs: formatting-check: name: Formatting Check runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip-ci')" steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4.1.7 + - name: Run clang-format style check for C programs. - uses: DoozyX/clang-format-lint-action@v0.14 + uses: DoozyX/clang-format-lint-action@v0.18.2 with: source: '.' extensions: 'c,h,cpp,hpp' diff --git a/.github/workflows/clang-format-fix.yml b/.github/workflows/clang-format-fix.yml index be7f1e9..e0a8d29 100644 --- a/.github/workflows/clang-format-fix.yml +++ b/.github/workflows/clang-format-fix.yml @@ -1,16 +1,32 @@ -name: clang-format Check +# NOTE: This action requires write permissions to be set in your GitHub +# repo/fork for it to be able to commit changes. +# +# This is currently enabled via: +# +# settings > Actions > General > Workflow permissions +# +# which you will need to set to "Read and write permissions" +# +name: clang-format Commit Changes on: workflow_dispatch: push: + +permissions: + contents: read + jobs: formatting-check: - name: Formatting Check + name: Commit Format Changes runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip-ci')" + permissions: + contents: write # In order to allow EndBug/add-and-commit to commit changes steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4.1.7 + - name: Run clang-format style check for C programs. - uses: DoozyX/clang-format-lint-action@v0.14 + uses: DoozyX/clang-format-lint-action@v0.18.2 with: source: '.' extensions: 'c,h,cpp,hpp' @@ -18,7 +34,8 @@ jobs: inplace: True style: file # exclude: './config ' - - uses: EndBug/add-and-commit@v7 + + - uses: EndBug/add-and-commit@v9.1.3 with: author_name: github-actions author_email: github-actions[bot]@users.noreply.github.com diff --git a/src/H5LS.c b/src/H5LS.c index 2e7f43d..bc0cf41 100644 --- a/src/H5LS.c +++ b/src/H5LS.c @@ -187,7 +187,9 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) { if (get_replacement_policy_from_str(mac) > 0) LS->replacement_policy = get_replacement_policy_from_str(mac); } else { - LOG_WARN(-1, "Unknown configuration setup:", ip); + snprintf(error_msg, ERROR_MSG_SIZE, "Unknown configuration setup: %s", + ip); + LOG_WARN(-1, "%s", error_msg); } } if (LS->mspace_total < LS->write_buffer_size) { @@ -202,7 +204,7 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) { struct stat sb; if (strcmp(LS->type, "GPU") == 0 || strcmp(LS->type, "MEMORY") == 0 || (stat(LS->path, &sb) == 0 && S_ISDIR(sb.st_mode))) { - return 0; + return SUCCEED; } else { int ret = snprintf(error_msg, ERROR_MSG_SIZE, "H5LSset: path %s does not exist\n", LS->path); @@ -212,6 +214,7 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) { LOG_ERROR(-1, "%s", error_msg); MPI_Abort(MPI_COMM_WORLD, 112); } + return SUCCEED; } /*------------------------------------------------------------------------- @@ -295,7 +298,7 @@ herr_t H5LSset(cache_storage_t *LS, char *type, char *path, struct stat sb; if (strcmp(type, "GPU") == 0 || strcmp(type, "MEMORY") == 0 || (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode))) { - return 0; + return SUCCEED; } else { LOG_ERROR(-1, "ERROR in name space for cache storage: %s does " @@ -303,6 +306,7 @@ herr_t H5LSset(cache_storage_t *LS, char *type, char *path, path); MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE); } + return SUCCEED; } /* end H5LSset */ /*------------------------------------------------------------------------- @@ -451,7 +455,7 @@ herr_t H5LSclaim_space(cache_storage_t *LS, hsize_t size, cache_claim_t type, } } - return 0; + return SUCCEED; } /*------------------------------------------------------------------------- @@ -490,7 +494,7 @@ herr_t H5LSremove_cache(cache_storage_t *LS, cache_t *cache) { #ifndef NDEBUG LOG_INFO(-1, "H5LSremove_space DONE"); #endif - return 0; + return SUCCEED; } /* end H5LSremove_cache() */ /*-------------------------------------------------------------------------