1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-25 14:42:52 +00:00

Minor bug fixes.

- set HAVE_MYSQL macro when MariaDB is used.
- fix a crash bug when wrong database is configured.
This commit is contained in:
Jonathan Xu
2019-08-07 19:29:08 +08:00
parent bb33ea7741
commit a300c1277a
3 changed files with 7 additions and 5 deletions

View File

@@ -241,6 +241,7 @@ else
AC_MSG_RESULT([${MYSQL_CFLAGS}])
AC_SUBST(MYSQL_CFLAGS)
AC_SUBST(MYSQL_LIBS)
AC_DEFINE([HAVE_MYSQL], 1, [Define to 1 if MySQL support is enabled])
fi
if test x${compile_python} = xyes; then

View File

@@ -53,7 +53,7 @@ static void usage ()
#define SEAFILE_RPC_PIPE_NAME "seafile.sock"
static void start_rpc_service (char *seafile_dir)
static void start_rpc_service (const char *seafile_dir)
{
SearpcNamedPipeServer *rpc_server = NULL;
char *pipe_path = NULL;

View File

@@ -53,9 +53,6 @@ seafile_session_new(const char *central_config_dir,
if (central_config_dir) {
abs_central_config_dir = ccnet_expand_path (central_config_dir);
}
config_file_path = g_build_filename(
abs_central_config_dir ? abs_central_config_dir : abs_seafile_dir,
"seafile.conf", NULL);
if (checkdir_with_mkdir (abs_seafile_dir) < 0) {
seaf_warning ("Config dir %s does not exist and is unable to create\n",
@@ -69,12 +66,17 @@ seafile_session_new(const char *central_config_dir,
goto onerror;
}
config_file_path = g_build_filename(
abs_central_config_dir ? abs_central_config_dir : abs_seafile_dir,
"seafile.conf", NULL);
GError *error = NULL;
config = g_key_file_new ();
if (!g_key_file_load_from_file (config, config_file_path,
G_KEY_FILE_NONE, &error)) {
seaf_warning ("Failed to load config file.\n");
g_key_file_free (config);
g_free (config_file_path);
goto onerror;
}
g_free (config_file_path);
@@ -164,7 +166,6 @@ seafile_session_new(const char *central_config_dir,
onerror:
free (abs_seafile_dir);
g_free (tmp_file_dir);
g_free (config_file_path);
g_free (session);
return NULL;
}