Skip to content
Snippets Groups Projects
Commit 0e4494c5 authored by Morris Jette's avatar Morris Jette
Browse files

Add error check

Coverity CID 44723
parent fcb20f02
No related branches found
No related tags found
No related merge requests found
...@@ -324,7 +324,8 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job) ...@@ -324,7 +324,8 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
_create_directories(); _create_directories();
/* Use a more user friendly string "batch" rather /*
* Use a more user friendly string "batch" rather
* then 4294967294. * then 4294967294.
*/ */
if (g_job->stepid == NO_VAL) { if (g_job->stepid == NO_VAL) {
...@@ -347,20 +348,25 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job) ...@@ -347,20 +348,25 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
profile_str, profile_file_name); profile_str, profile_file_name);
} }
// Create a new file using the default properties. /*
* Create a new file using the default properties
*/
file_id = H5Fcreate(profile_file_name, H5F_ACC_TRUNC, H5P_DEFAULT, file_id = H5Fcreate(profile_file_name, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT); H5P_DEFAULT);
if (chown(profile_file_name, (uid_t)g_job->uid, if (chown(profile_file_name, (uid_t)g_job->uid,
(gid_t)g_job->gid) < 0) (gid_t)g_job->gid) < 0)
error("chown(%s): %m", profile_file_name); error("chown(%s): %m", profile_file_name);
chmod(profile_file_name, 0600); if (chmod(profile_file_name, 0600) < 0)
error("chmod(%s): %m", profile_file_name);
xfree(profile_file_name); xfree(profile_file_name);
if (file_id < 1) { if (file_id < 1) {
info("PROFILE: Failed to create Node group"); info("PROFILE: Failed to create Node group");
return SLURM_FAILURE; return SLURM_FAILURE;
} }
/* fd_set_close_on_exec(file_id); Not supported for HDF5 */ /*
* fd_set_close_on_exec(file_id); Not supported for HDF5
*/
sprintf(group_node, "/%s", g_job->node_name); sprintf(group_node, "/%s", g_job->node_name);
gid_node = make_group(file_id, group_node); gid_node = make_group(file_id, group_node);
if (gid_node < 0) { if (gid_node < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment