mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-25 22:48:36 +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:
@@ -241,6 +241,7 @@ else
|
|||||||
AC_MSG_RESULT([${MYSQL_CFLAGS}])
|
AC_MSG_RESULT([${MYSQL_CFLAGS}])
|
||||||
AC_SUBST(MYSQL_CFLAGS)
|
AC_SUBST(MYSQL_CFLAGS)
|
||||||
AC_SUBST(MYSQL_LIBS)
|
AC_SUBST(MYSQL_LIBS)
|
||||||
|
AC_DEFINE([HAVE_MYSQL], 1, [Define to 1 if MySQL support is enabled])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x${compile_python} = xyes; then
|
if test x${compile_python} = xyes; then
|
||||||
|
@@ -53,7 +53,7 @@ static void usage ()
|
|||||||
|
|
||||||
#define SEAFILE_RPC_PIPE_NAME "seafile.sock"
|
#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;
|
SearpcNamedPipeServer *rpc_server = NULL;
|
||||||
char *pipe_path = NULL;
|
char *pipe_path = NULL;
|
||||||
|
@@ -53,9 +53,6 @@ seafile_session_new(const char *central_config_dir,
|
|||||||
if (central_config_dir) {
|
if (central_config_dir) {
|
||||||
abs_central_config_dir = ccnet_expand_path (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) {
|
if (checkdir_with_mkdir (abs_seafile_dir) < 0) {
|
||||||
seaf_warning ("Config dir %s does not exist and is unable to create\n",
|
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;
|
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;
|
GError *error = NULL;
|
||||||
config = g_key_file_new ();
|
config = g_key_file_new ();
|
||||||
if (!g_key_file_load_from_file (config, config_file_path,
|
if (!g_key_file_load_from_file (config, config_file_path,
|
||||||
G_KEY_FILE_NONE, &error)) {
|
G_KEY_FILE_NONE, &error)) {
|
||||||
seaf_warning ("Failed to load config file.\n");
|
seaf_warning ("Failed to load config file.\n");
|
||||||
g_key_file_free (config);
|
g_key_file_free (config);
|
||||||
|
g_free (config_file_path);
|
||||||
goto onerror;
|
goto onerror;
|
||||||
}
|
}
|
||||||
g_free (config_file_path);
|
g_free (config_file_path);
|
||||||
@@ -164,7 +166,6 @@ seafile_session_new(const char *central_config_dir,
|
|||||||
onerror:
|
onerror:
|
||||||
free (abs_seafile_dir);
|
free (abs_seafile_dir);
|
||||||
g_free (tmp_file_dir);
|
g_free (tmp_file_dir);
|
||||||
g_free (config_file_path);
|
|
||||||
g_free (session);
|
g_free (session);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user