>  
> @@ -320,9 +324,11 @@ DICT   *dict_sqlite_open(const char *name, int 
> open_flags, int dict_flags)
>      dict_sqlite->parser = parser;
>      sqlite_parse_config(dict_sqlite, name);
>  
> -    if (sqlite3_open(dict_sqlite->dbpath, &dict_sqlite->db))
> -     msg_fatal("%s:%s: Can't open database: %s\n",
> -               DICT_TYPE_SQLITE, name, sqlite3_errmsg(dict_sqlite->db));
> +    if (sqlite3_open_v2(dict_sqlite->dbpath, &dict_sqlite->db,
> +                     SQLITE_OPEN_READONLY, NULL))
> +     msg_fatal("%s:%s: Can't open database: %s (%s)\n",
> +               DICT_TYPE_SQLITE, name, sqlite3_errmsg(dict_sqlite->db),
> +               strerror(errno));

Instead of msg_fatal(), can we call dict_surrogate() instead? It
allows the program to continue in a degraded mode. If it does not
use database, then the program runs as normal, and if it does use
the database, the access returns a proper error code.

Examples of dict_surrogate() are plentiful.

        Wietse
_______________________________________________
Postfix-devel mailing list -- postfix-devel@postfix.org
To unsubscribe send an email to postfix-devel-le...@postfix.org

Reply via email to