diff options
-rwxr-xr-x | tool/sp_initdb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tool/sp_initdb.c b/tool/sp_initdb.c index fc0f1f6..f221fee 100755 --- a/tool/sp_initdb.c +++ b/tool/sp_initdb.c @@ -152,8 +152,14 @@ static int __open_db(void) return -1; } - if (access(PATH_DB_JOURNAL, F_OK) == 0) - smack_setlabel(PATH_DB_JOURNAL, DB_LABEL, SMACK_LABEL_ACCESS); + if (access(PATH_DB_JOURNAL, F_OK) == 0) { + ret = smack_setlabel(PATH_DB_JOURNAL, DB_LABEL, SMACK_LABEL_ACCESS); + if (ret < 0) { + printf("Failed to set label of journal file\n"); + __close_db(); + return -1; + } + } return 0; } |