made POSIX compliant

This commit is contained in:
Celine Mercier
2016-03-21 11:33:06 +01:00
parent 383e738ab7
commit b04b4b5902
8 changed files with 48 additions and 26 deletions

View File

@@ -65,7 +65,8 @@ static char* build_column_directory_name(const char* column_name)
char* column_directory_name;
// Build the database directory name
if (asprintf(&column_directory_name, "%s.obicol", column_name) < 0)
column_directory_name = (char*) malloc((strlen(column_name) + 8)*sizeof(char));
if (sprintf(column_directory_name, "%s.obicol", column_name) < 0)
{
obi_set_errno(OBICOLDIR_MEMORY_ERROR);
obidebug(1, "\nError building a column directory name");
@@ -104,7 +105,7 @@ int obi_column_directory_exists(OBIDMS_p dms, const char* column_name)
return -1;
// Get the full path for the column directory
full_path = get_full_path(dms->dir_fd, column_directory_name);
full_path = get_full_path(dms, column_directory_name);
if (full_path == NULL)
{
obi_set_errno(OBICOLDIR_UNKNOWN_ERROR);
@@ -169,7 +170,7 @@ OBIDMS_column_directory_p obi_open_column_directory(OBIDMS_p dms, const char* co
return NULL;
// Try to open the column directory
directory = private_opendirat(dms->dir_fd, column_directory_name);
directory = opendir_in_dms(dms, column_directory_name);
if (directory == NULL) {
switch (errno)
{