From 25955ec1e6dee484c7e364d71410e89636833061 Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Mon, 24 Oct 2022 18:12:18 -0600 Subject: [PATCH] Added error-checking for lfs setstripe call --- src/seism-core-slice.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/seism-core-slice.cc b/src/seism-core-slice.cc index 6289a81..51ce1f4 100644 --- a/src/seism-core-slice.cc +++ b/src/seism-core-slice.cc @@ -310,9 +310,16 @@ int main(int argc, char** argv) if (lfs_stripe_count) sprintf(lfs_count_str, "-c %d ", lfs_stripe_count); char lfs_command[256]; cout << "Setting striping info:" << endl; - sprintf(lfs_command, "lfs setstripe %s %s %s > /dev/null ", lfs_size_str, lfs_count_str, filename); + // sprintf(lfs_command, "lfs setstripe %s %s %s > /dev/null ", lfs_size_str, lfs_count_str, filename); + sprintf(lfs_command, "lfs setstripe %s %s %s ", lfs_size_str, lfs_count_str, filename); cout << lfs_command << endl << endl; - assert(system(lfs_command) == 0) ; // run striping command on shell. + // assert(system(lfs_command) == 0) ; // run striping command on shell. + int retval = system(lfs_command); // run striping command on shell. + if (retval != 0) + { + printf(">>>%s<<<\nCommand failed.\n", lfs_command); + exit(retval); + } } } }