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é
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
0fa2e54c
Vérifiée
Valider
0fa2e54c
rédigé
5 years ago
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fix the database init
parent
29d49d6d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!64
Resolve "Installation"
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
scripts/init.sql
+3
-1
3 ajouts, 1 suppression
scripts/init.sql
src/main/lktadm.c
+4
-4
4 ajouts, 4 suppressions
src/main/lktadm.c
avec
7 ajouts
et
5 suppressions
scripts/init.sql
+
3
−
1
Voir le fichier @
0fa2e54c
...
@@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS users
...
@@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS users
,
PRIMARY
KEY
(
username
,
password
)
,
PRIMARY
KEY
(
username
,
password
)
)
WITHOUT
ROWID
;
)
WITHOUT
ROWID
;
INSERT
INTO
OR
REPLACE
users
(
username
,
password
)
VALUES
(
'sakura'
,
'hashire'
);
INSERT
OR
REPLACE
INTO
users
(
username
,
password
)
VALUES
(
'sakura'
,
'hashire'
);
-- The stickers table
-- The stickers table
...
@@ -141,3 +141,5 @@ CREATE VIEW IF NOT EXISTS queue_ AS
...
@@ -141,3 +141,5 @@ CREATE VIEW IF NOT EXISTS queue_ AS
priority
,
priority
,
queue
.
position
AS
old_position
queue
.
position
AS
old_position
FROM
queue
;
FROM
queue
;
.
exit
Ce diff est replié.
Cliquez pour l'agrandir.
src/main/lktadm.c
+
4
−
4
Voir le fichier @
0fa2e54c
...
@@ -220,7 +220,7 @@ init_database__(struct lkt_cmd_args *args)
...
@@ -220,7 +220,7 @@ init_database__(struct lkt_cmd_args *args)
pid_t
pid
;
pid_t
pid
;
int
wstatus
,
status
,
fd
;
int
wstatus
,
status
,
fd
;
open_db
();
open_db
();
char
*
sqlite_args
[]
=
{
sqlite3_bin
,
db_path
};
char
*
sqlite_args
[]
=
{
sqlite3_bin
,
db_path
,
NULL
};
if
((
pid
=
fork
())
==
0
)
{
if
((
pid
=
fork
())
==
0
)
{
if
((
fd
=
open
(
init_script
,
O_RDONLY
))
<
0
)
if
((
fd
=
open
(
init_script
,
O_RDONLY
))
<
0
)
...
@@ -229,8 +229,8 @@ init_database__(struct lkt_cmd_args *args)
...
@@ -229,8 +229,8 @@ init_database__(struct lkt_cmd_args *args)
if
(
dup2
(
fd
,
0
)
<
0
)
if
(
dup2
(
fd
,
0
)
<
0
)
fail
(
"Failed to duplicate %s to stdin"
,
init_script
);
fail
(
"Failed to duplicate %s to stdin"
,
init_script
);
execv
(
sqlite
3_bin
,
sqlite_args
);
execv
p
(
sqlite
_args
[
0
]
,
sqlite_args
);
fail
(
"Failed to execute %s"
,
sqlite3_bin
);
fail
(
"Failed to execute
%s:
%s"
,
sqlite3_bin
,
strerror
(
errno
)
);
}
}
else
if
(
pid
<
0
)
else
if
(
pid
<
0
)
...
@@ -243,7 +243,7 @@ init_database__(struct lkt_cmd_args *args)
...
@@ -243,7 +243,7 @@ init_database__(struct lkt_cmd_args *args)
while
(
!
WIFEXITED
(
wstatus
)
&&
!
WIFSIGNALED
(
wstatus
));
while
(
!
WIFEXITED
(
wstatus
)
&&
!
WIFSIGNALED
(
wstatus
));
if
((
status
=
WEXITSTATUS
(
wstatus
)))
if
((
status
=
WEXITSTATUS
(
wstatus
)))
fail
(
"Children failed with status %d"
,
status
);
fail
(
"Children failed with status %d
\n
"
,
status
);
}
}
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
...
...
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