#include "sqlite.hh" #include "util.hh" #include namespace nix { [[noreturn]] void throwSQLiteError(sqlite3 * db, const format & f) { int err = sqlite3_errcode(db); if (err == SQLITE_BUSY || err == SQLITE_PROTOCOL) { if (err == SQLITE_PROTOCOL) printMsg(lvlError, "warning: SQLite database is busy (SQLITE_PROTOCOL)"); else { static bool warned = false; if (!warned) { printMsg(lvlError, "warning: SQLite database is busy"); warned = true; } } /* Sleep for a while since retrying the transaction right away is likely to fail again. */ #if HAVE_NANOSLEEP struct timespec t; t.tv_sec = 0; t.tv_nsec = (random() % 100) * 1000 * 1000; /* <= 0.1s */ nanosleep(&t, 0); #else sleep(1); #endif throw SQLiteBusy(format("%1%: %2%") % f.str() % sqlite3_errmsg(db)); } else throw SQLiteError(format("%1%: %2%") % f.str() % sqlite3_errmsg(db)); } SQLi
aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/augeas.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2016-04-28 08:11:05 +0200
committerRicardo Wurmus <rekado@elephly.net>2016-05-01 18:15:59 +0200
commit1b90e57eb75e760bd83acb39a0f8085d22d3813d (patch)
tree0becdcde702335fbfdd3f0a12a4692052572a93f /gnu/packages/augeas.scm
parenta66a60f251e38424078f2881522d0956e2f3643a (diff)
downloadguix-1b90e57eb75e760bd83acb39a0f8085d22d3813d.tar.gz
guix-1b90e57eb75e760bd83acb39a0f8085d22d3813d.zip
gnu: Add antiword.
* gnu/packages/textutils.scm (antiword): New variable.
Diffstat (limited to 'gnu/packages/augeas.scm')
0 files changed, 0 insertions, 0 deletions