Add missing hdb_handle_put in totemsrp and handle errors in mkdir and

chdir properly.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1818 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2009-03-10 11:30:34 +00:00
parent 9d1c727a82
commit 5129befb9b

View File

@ -722,7 +722,14 @@ int totemsrp_initialize (
}
res = mkdir (rundir, 0700);
chdir (rundir);
if (res == -1) {
goto error_put;
}
res = chdir (rundir);
if (res == -1) {
goto error_put;
}
totemsrp_instance_initialize (instance);
@ -853,8 +860,13 @@ int totemsrp_initialize (
MESSAGE_QUEUE_MAX,
sizeof (struct message_item));
hdb_handle_put (&totemsrp_instance_database, *handle);
return (0);
error_put:
hdb_handle_put (&totemsrp_instance_database, *handle);
error_destroy:
hdb_handle_destroy (&totemsrp_instance_database, *handle);