Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
c818b8ab
Vérifiée
Valider
c818b8ab
rédigé
Il y a 5 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Cleaning the startup
parent
c57466c1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!87
Resolve "Segfault on exit"
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
src/main/server.c
+14
-15
14 ajouts, 15 suppressions
src/main/server.c
avec
14 ajouts
et
15 suppressions
src/main/server.c
+
14
−
15
Voir le fichier @
c818b8ab
...
...
@@ -60,22 +60,21 @@ main(int argc, char *argv[])
return
EXIT_FAILURE
;
normal_launch:
LOG_INFO
(
"Lektor launched by user %s (shell: %s, home: %s)"
,
pw
->
pw_name
,
pw
->
pw_shell
,
pw
->
pw_dir
);
LOG_INFO_SCT
(
"GENERAL"
,
"Lektor launched by user %s (shell: %s, home: %s)"
,
pw
->
pw_name
,
pw
->
pw_shell
,
pw
->
pw_dir
);
reg_set
(
server_reg
);
mthread_init
();
pthread_create
(
&
th
,
NULL
,
mthread_main
,
NULL
);
if
(
read_self_exe
(
exe
,
PATH_MAX
))
LOG_WARN_SCT
(
"GENERAL"
,
"%s"
,
"Failed to read self executable path, restart may not work"
);
LOG_WARN_SCT
(
"GENERAL"
,
"%s"
,
"Failed to read self executable path, "
"restart may not work"
);
executable_name
=
exe
;
/* Init the server */
char
*
memory
=
(
char
*
)
safe_malloc
((
2
*
PATH_MAX
+
HOST_NAME_MAX
+
3
)
*
sizeof
(
char
));
RETURN_UNLESS
(
memory
,
"Out of memory"
,
5
);
struct
lkt_state
srv
;
int
autoclear
,
check_exclusive
=
1
;
char
*
const
db_path
=
safe_malloc
(
PATH_MAX
*
sizeof
(
char
));
char
*
const
kara_dir
=
safe_malloc
(
PATH_MAX
*
sizeof
(
char
));
char
*
db_path
=
safe_malloc
(
PATH_MAX
*
sizeof
(
char
));
char
*
kara_dir
=
safe_malloc
(
PATH_MAX
*
sizeof
(
char
));
char
conf_file
[
PATH_MAX
];
memset
(
&
srv
,
0
,
sizeof
(
struct
lkt_state
));
...
...
@@ -85,14 +84,14 @@ normal_launch:
RETURN_IF
(
config_new
(
srv
.
db
,
conf_file
),
"Failed to read configuration file"
,
1
);
/* Finish to initialize. */
RETURN_UNLESS
(
database_config_get_text
(
srv
.
db
,
"database"
,
"db_path"
,
db_path
,
PATH_MAX
)
,
"Cfg error"
,
2
)
;
database_config_get_text
(
srv
.
db
,
"database"
,
"db_path"
,
db_path
,
PATH_MAX
);
RETURN_UNLESS
(
database_open
(
srv
.
db
,
db_path
,
check_exclusive
),
"Can't open database"
,
1
);
/* Read the configuration. */
RETURN_UNLESS
(
database_config_get_int
(
srv
.
db
,
"player"
,
"autoclear"
,
&
autoclear
)
,
"Cfg error"
,
2
)
;
RETURN_UNLESS
(
database_config_get_text
(
srv
.
db
,
"database"
,
"kara_dir"
,
kara_dir
,
PATH_MAX
)
,
"Cfg error"
,
2
)
;
RETURN_UNLESS
(
database_config_get_text
(
srv
.
db
,
"server"
,
"host"
,
srv
.
host
,
HOST_NAME_MAX
)
,
"Cfg error"
,
2
)
;
RETURN_UNLESS
(
database_config_get_text
(
srv
.
db
,
"server"
,
"port"
,
srv
.
port
,
5
)
,
"Cfg error"
,
2
)
;
/* Read the configuration.
We already know that the config is valid
*/
database_config_get_int
(
srv
.
db
,
"player"
,
"autoclear"
,
&
autoclear
);
database_config_get_text
(
srv
.
db
,
"database"
,
"kara_dir"
,
kara_dir
,
PATH_MAX
);
database_config_get_text
(
srv
.
db
,
"server"
,
"host"
,
srv
.
host
,
HOST_NAME_MAX
);
database_config_get_text
(
srv
.
db
,
"server"
,
"port"
,
srv
.
port
,
5
);
if
(
kara_dir
[
strlen
(
kara_dir
)
-
1
]
!=
'/'
)
strncat
(
kara_dir
,
"/"
,
PATH_MAX
-
1
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter