diff --git a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
index 0d81e88ace3430df2f7dd4391840d0fe180d94a4..4810e8150d57ae182d53a34e5572d09d3db48a3a 100644
--- a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
+++ b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
@@ -324,7 +324,8 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
 
 	_create_directories();
 
-	/* Use a more user friendly string "batch" rather
+	/*
+	 * Use a more user friendly string "batch" rather
 	 * then 4294967294.
 	 */
 	if (g_job->stepid == NO_VAL) {
@@ -347,20 +348,25 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
 		     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,
 			    H5P_DEFAULT);
 	if (chown(profile_file_name, (uid_t)g_job->uid,
 		  (gid_t)g_job->gid) < 0)
 		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);
 
 	if (file_id < 1) {
 		info("PROFILE: Failed to create Node group");
 		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);
 	gid_node = make_group(file_id, group_node);
 	if (gid_node < 0) {