ccan
9 years agotdb2: change API to return the error value.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: change API to return the error value.

Mostly a fairly simple transformation, since 0 still means success.

One new twist is that tdb_nextkey now frees the .dptr of the key; this
us usually what we want but does cause issues for our weird test code.

9 years agotdb2: rework tdb.c internal functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework tdb.c internal functions to return enum TDB_ERROR.

9 years agotdb2: rework summary.c internal functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework summary.c internal functions to return enum TDB_ERROR.

9 years agotdb2: rework check.c internal functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework check.c internal functions to return enum TDB_ERROR.

Of course, we leave the API the same, but percolate error codes all the
way back to tdb_check().

9 years agotdb2: rework transaction.c internal functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework transaction.c internal functions to return enum TDB_ERROR.

In particular, tdb_needs_recovery() can now indicate an error occurred,
rather than returning true.

9 years agotdb2: rework free.c functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework free.c functions to return enum TDB_ERROR.

9 years agotdb2: rework hash.c functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework hash.c functions to return enum TDB_ERROR.

This time we have to use our tri-value "tdb_bool_err" type to indicate
true, false, or error, which now allows us to correctly handle errors
in key matching (rather than treating it as a non-match).

9 years agotdb2: rework remaining io.c functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework remaining io.c functions to return enum TDB_ERROR.

In particular, we replace the TDB_OFF_ERR ((off_t)-1) with a range of
negative error values.

9 years agotdb2: rework some io.c functions to encode errors in their pointer returns.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework some io.c functions to encode errors in their pointer returns.

This causes a subtle enhancement in tdb_direct(): it previously
returned NULL on both "can't use direct access" or "some error
occurred", as the caller always uses read/write functions as a
fallback anyway.  Now we distinguish the error case.

9 years agotdb2: rework some io.c functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework some io.c functions to return enum TDB_ERROR.

9 years agotdb2: rework io functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework io functions to return enum TDB_ERROR.

We have a series of I/O functions which change depending on whether we're
inside a transaction or not.  This makes them return enum TDB_ERROR instead
of int.

9 years agotdb2: restore file filling code.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: restore file filling code.

This snuck in fe55330a which added the stats attribute.  Without it,
TDB works but is vulnerable to segmenation faults or write errors when
disk is exhausted.

9 years agotdb2: rework lock.c functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework lock.c functions to return enum TDB_ERROR.

Make the other functions in lock.s return an error code, too.

9 years agotdb2: rework lock.c static functions to return enum TDB_ERROR.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: rework lock.c static functions to return enum TDB_ERROR.

We make tdb_brlock() and tdb_lock_gradual() return an error code directly:
the callers have to set tdb->ecode.

9 years agotdb2: Internal error helpers.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: Internal error helpers.

I use the "high pointers hold error numbers" trick, and also make
tdb_logerr return the error code, which enables the common case of
"return tdb_logerr(...)".

9 years agotdb2: make error numbers negative.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: make error numbers negative.

This prepares us for changing function returns over.

9 years agotdb2: remove tdb_traverse_read
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: remove tdb_traverse_read

It's not actually different from tdb_traverse().  We can re-add it later if
it makes sense.

9 years agotdb2: add comments to tdb2.h, reorder for maximum readability.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: add comments to tdb2.h, reorder for maximum readability.

9 years agotdb2: remove redundant pending transaction error check.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: remove redundant pending transaction error check.

We do this lower down anyway.

9 years agotdb2: remove tdb_hashfn_t prototype
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: remove tdb_hashfn_t prototype

It doesn't help the user, since they can't use it to declare their hash
function, and it just adds a level of mental indirection for us.

9 years agotdb2: remove nesting support.
Rusty Russell [Tue, 1 Mar 2011 12:49:19 +0000 (23:19 +1030)]
tdb2: remove nesting support.

We don't actually support it, so take it away for the moment.  If you
try to nmest you get a TDB_LOG_USE_ERROR message.

9 years agotdb2: simplify logging levels, rename TDB_DEBUG_* to TDB_LOG_*
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: simplify logging levels, rename TDB_DEBUG_* to TDB_LOG_*

It was never clear to me which levels should be used for what cases.
I can only usefully distinguish three at the moment:
(1) TDB errors, which render the TDB unreliable.
(2) TDB user errors, caused by API misuse.
(3) TDB notifications of strange behaviour, from which we have recovered.

9 years agotdb2: remove extraneous whitespace.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: remove extraneous whitespace.

Gets us one extra ccanlint point, too.

9 years agotdb2: fix leak on lock failure during open.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: fix leak on lock failure during open.

9 years agotdb2: log as a ERROR (not as TRACE) when unlocking fails.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: log as a ERROR (not as TRACE) when unlocking fails.

This should never happen.

9 years agotdb2: log a message on allocation failure in tdb_check()
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: log a message on allocation failure in tdb_check()

9 years agotdb2: log an error when out of memory formatting message.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: log an error when out of memory formatting message.

Log it at level ERROR and log the raw unformatted message at the requested
level.

9 years agotdb2: close memory leak in traverse.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: close memory leak in traverse.

9 years agotdb2: close memory leak in tdb_check()
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: close memory leak in tdb_check()

9 years agotdb2: use failtest for opening and checking database.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: use failtest for opening and checking database.

This is a fairly sophisticated use of failtest:
1) There are a few places where we can inject failures without revealing it
   at the API level, eg. opening /dev/urandom, or allocation failure in logging.
2) We want to be sure that (almost) all failures cause a message to be logged.
3) We need to exit as soon as possible when a failure is injected, to avoid
   combinatorial explosion.
4) We don't want to simply exit on any log message, since we want to be sure
   that cleanup happens.

This test found four different bugs failure paths.  Erk!

9 years agotdb2: fix leak in tests.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: fix leak in tests.

9 years agotdb2: rename ->read and ->write functions.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: rename ->read and ->write functions.

Since failtest uses macros to override read and write, we need to avoid
those names, even inside our ops structure.

9 years agotdb2: remove looping for write
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: remove looping for write

On normal files, pwrite and write should never return short except on error.
As we never create sparse files, so any short write is an I/O error.

9 years agotdb2: remove looping for read on normal files.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
tdb2: remove looping for read on normal files.

Simply assume that any short read on a TDB in an I/O error.

9 years agofailtest: enhance tracing
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
failtest: enhance tracing

Do it properly, with a printf-style interface.

9 years agoccanlint: prepend module headers before standard ones.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
ccanlint: prepend module headers before standard ones.

Especially since they probably define _GNU_SOURCE.

9 years agoconfig.h: HAVE_ASPRINTF
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
config.h: HAVE_ASPRINTF

9 years agoconfig.h: define _GNU_SOURCE
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
config.h: define _GNU_SOURCE

Otherwise we don't get goodies like asprintf, and 64-bit offsets.  Should
be a harmless-define on non-glibc systems.

9 years agoccanlint: don't crash when given --target=hash_if and there's no _info file.
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
ccanlint: don't crash when given --target=hash_if and there's no _info file.

9 years agonoerr: don't use tempnam
Rusty Russell [Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)]
noerr: don't use tempnam

We run in a temporary directory now.  Also, avoids warning and memory leak.

9 years agofailtest: Fix incorrect reuse of va_list in test/run-malloc.c.
Andreas Schlick [Thu, 24 Feb 2011 16:27:11 +0000 (17:27 +0100)]
failtest: Fix incorrect reuse of va_list in test/run-malloc.c.

9 years agoendian: use byteswap.h where available
Rusty Russell [Tue, 1 Mar 2011 07:21:22 +0000 (17:51 +1030)]
endian: use byteswap.h where available

And use those names, too.

9 years agocompiler, talloc, tap, tdb2: use #if instead of #ifdef.
Rusty Russell [Tue, 1 Mar 2011 07:20:07 +0000 (17:50 +1030)]
compiler, talloc, tap, tdb2: use #if instead of #ifdef.

9 years agoccanlint: check for #ifdef
Rusty Russell [Tue, 1 Mar 2011 07:20:32 +0000 (17:50 +1030)]
ccanlint: check for #ifdef

Old habits die hard; it's better to use #if <FEATURE> than #ifdef <FEATURE>;
they're similar, because undefined identifiers evaluate to zero, but with
GCC's -Wundef flag you can detect mis-spelled or missing features with
#if.

autoconf-style config.h leave unset features undefined, so this works for
those config.h too.

9 years agoccanlint: run tests with reduced-feature config.h
Rusty Russell [Tue, 1 Mar 2011 07:17:49 +0000 (17:47 +1030)]
ccanlint: run tests with reduced-feature config.h

9 years agoccanlint: compile module with reduced-feature config.h
Rusty Russell [Tue, 1 Mar 2011 07:17:24 +0000 (17:47 +1030)]
ccanlint: compile module with reduced-feature config.h

9 years agoccanlint: create reduce-feature config.h
Rusty Russell [Tue, 1 Mar 2011 07:18:11 +0000 (17:48 +1030)]
ccanlint: create reduce-feature config.h

A common mistake is not to try compiling with features disabled in
config.h.  The ideal case would determine how features interact and
test all combinations of them: this simply disables any features
mentioned in the code which were previously enabled.

9 years agoccanlint: --compiler and --cflags options.
Rusty Russell [Tue, 1 Mar 2011 05:34:49 +0000 (16:04 +1030)]
ccanlint: --compiler and --cflags options.

9 years agoccanlint: read config.h to get compilation flags at runtime.
Rusty Russell [Tue, 1 Mar 2011 05:38:57 +0000 (16:08 +1030)]
ccanlint: read config.h to get compilation flags at runtime.

This means you don't have to recompile ccanlint to get the new flags;
it's a small step towards making ccanlint useful outside the ccan repo.

9 years agoccanlint: handle weird directories.
Rusty Russell [Tue, 1 Mar 2011 05:31:20 +0000 (16:01 +1030)]
ccanlint: handle weird directories.

David Gibson reports (and I confirmed) that running ccanlint in /tmp
causes an very uninformative segv.  Fix that, and add a more useful message,
as well as delaying recursing until we're confident there's code around.

9 years agoconfig.h: idempotent-wrap the generated config.h
Rusty Russell [Tue, 1 Mar 2011 05:30:05 +0000 (16:00 +1030)]
config.h: idempotent-wrap the generated config.h

9 years agoasort: handle !HAVE_NESTED_FUNCTIONS
Rusty Russell [Tue, 1 Mar 2011 05:29:40 +0000 (15:59 +1030)]
asort: handle !HAVE_NESTED_FUNCTIONS

Andreas Schlick reports that PaX et. al. dislike trampolines, so open-code
qsort from glibc.

Interestingly, _quicksort from glibc seems to have a void * parameter, but
I can't find any information on it.

9 years agofailtest: fix locking code.
Rusty Russell [Tue, 1 Mar 2011 00:52:56 +0000 (11:22 +1030)]
failtest: fix locking code.

We need to get the locks back *after* the child runs.

9 years agofailtest: fix tracepath bug.
Rusty Russell [Tue, 1 Mar 2011 00:52:39 +0000 (11:22 +1030)]
failtest: fix tracepath bug.

Aborts on a short write with --tracepath.

9 years agotdb2: make tdb2 compile clean under -Wshadow.
Rusty Russell [Thu, 24 Feb 2011 05:33:46 +0000 (16:03 +1030)]
tdb2: make tdb2 compile clean under -Wshadow.

This isn't a general requirement for CCAN modules, but Samba uses it, so
make sure tdb2 doesn't upset it.

9 years agojmap,likely,tdb2: use CCAN_<MODNAME>_DEBUG instead of DEBUG.
Rusty Russell [Thu, 24 Feb 2011 05:09:32 +0000 (15:39 +1030)]
jmap,likely,tdb2: use CCAN_<MODNAME>_DEBUG instead of DEBUG.

Samba (for example) uses a DEBUG() macro, which triggers these heuristics.
Better to make it per-module anyway.

9 years agoccanlint: fix more potential segvs when reporting ccanlint errors.
Rusty Russell [Thu, 24 Feb 2011 02:50:01 +0000 (13:20 +1030)]
ccanlint: fix more potential segvs when reporting ccanlint errors.

When I changed score_file_error() to printf-style, I didn't audit all
the callers who were handing string literals.  I've finally done that;
I should have broken the compile by renaming it.

Rusty fails refactoring 101.
Reported-by: Andreas Schlick
9 years agoccan_tokenizer: update to be compatible with darray.
Joey Adams [Sat, 19 Feb 2011 10:53:04 +0000 (05:53 -0500)]
ccan_tokenizer: update to be compatible with darray.

9 years agodarray: Renamed array module to darray and made several improvements.
Joey Adams [Sat, 19 Feb 2011 10:36:14 +0000 (05:36 -0500)]
darray: Renamed array module to darray and made several improvements.

 * Removed talloc support.
 * Added a synopsis and rearranged macro definitions.
 * Switched allocation strategy from increments of 64 to powers of 2.
 * Replaced array_for and array_rof with the more useful
   and portable macros array_foreach and array_foreach_reverse.
 * Added typedefs array_* for common types.

9 years agofailtest: detect leaks in children.
Rusty Russell [Tue, 15 Feb 2011 13:02:13 +0000 (23:32 +1030)]
failtest: detect leaks in children.

If we need to clean up the children, they didn't exit cleanly.

This takes a bit more care when writing tests, but found a leak in tdb2.

9 years agofailtest: hook can return FAIL_PROBE
Rusty Russell [Tue, 15 Feb 2011 13:01:29 +0000 (23:31 +1030)]
failtest: hook can return FAIL_PROBE

tdb2 has various places where it recovers from failure (eg. falling
back when it can't open /dev/urandom, or allocation for error
logging).  We want to test those paths, but doing so thoroughly causes
cominatorial explosion.

Add FAIL_PROBE for such cases: in this case it goes only 3 more calls
deep.

9 years agofailtest: record close events
Rusty Russell [Tue, 15 Feb 2011 12:59:13 +0000 (23:29 +1030)]
failtest: record close events

We trap them, might as well put them in history.  This also makes tracking
open file descriptors more robust.

9 years agofailtest: call failtest_exit_check even in non-failing parent.
Rusty Russell [Tue, 15 Feb 2011 12:59:28 +0000 (23:29 +1030)]
failtest: call failtest_exit_check even in non-failing parent.

9 years agofailtest: be clearer when child times out.
Rusty Russell [Tue, 15 Feb 2011 12:57:43 +0000 (23:27 +1030)]
failtest: be clearer when child times out.

ie. SIGUSR1 means it timed out.

9 years agofailtest: --debugpath= for really hard-to-find bugs.
Rusty Russell [Tue, 15 Feb 2011 12:57:15 +0000 (23:27 +1030)]
failtest: --debugpath= for really hard-to-find bugs.

If children and parents aren't isolated properly (ie. failtest is
buggy) we really want to run gdb on a failing child.  This hack allows that.

9 years agofailtest: don't insert spurious failures if open would fail anyway.
Rusty Russell [Tue, 15 Feb 2011 12:55:40 +0000 (23:25 +1030)]
failtest: don't insert spurious failures if open would fail anyway.

open fails in fairly normal cases; don't double execution time for this!

9 years agofailtest: don't insist parents and children write the same thing to files.
Rusty Russell [Tue, 15 Feb 2011 12:55:03 +0000 (23:25 +1030)]
failtest: don't insist parents and children write the same thing to files.

We insist they write the same things to pipes, since we can't "undo" them,
but strictly speaking we don't care if they write different things into
files.

Note: it may indicate a bug if they do...

9 years agofailtest: rely on the save/restore of files, don't use write cleanup.
Rusty Russell [Tue, 15 Feb 2011 12:53:59 +0000 (23:23 +1030)]
failtest: rely on the save/restore of files, don't use write cleanup.

9 years agofailtest: save entire file contents.
Rusty Russell [Tue, 15 Feb 2011 12:53:16 +0000 (23:23 +1030)]
failtest: save entire file contents.

The idea of saving files as we do writes doesn't work with mmap: this just
saves the entire contents of all open files before forking child, and
restores them afterwards.

9 years agofailtest: don't use special data structure for storing child writes.
Rusty Russell [Tue, 15 Feb 2011 12:52:17 +0000 (23:22 +1030)]
failtest: don't use special data structure for storing child writes.

Use the same structure we use in the history.

9 years agofailtest: generic cleanup hooks
Rusty Russell [Tue, 15 Feb 2011 12:51:42 +0000 (23:21 +1030)]
failtest: generic cleanup hooks

Each function in the history stores a cleanup function, rather than storing
extra structures.  In particular, we save writes and file offsets using
this.

9 years agofailtest: allow continuing after running a failpath.
Rusty Russell [Tue, 15 Feb 2011 12:49:00 +0000 (23:19 +1030)]
failtest: allow continuing after running a failpath.

Append a "+" if you want to start forking as normal.

9 years agofailtest: --tracepath
Rusty Russell [Tue, 15 Feb 2011 12:48:31 +0000 (23:18 +1030)]
failtest: --tracepath

Useful for showing exactly where we inserted failures, and how long each
one took.

9 years agofailtest: fix history when --failpath used
Rusty Russell [Tue, 15 Feb 2011 12:32:16 +0000 (23:02 +1030)]
failtest: fix history when --failpath used

Correctly mark which calls we failed.

9 years agofailtest: capture pread/pwrite
Rusty Russell [Tue, 15 Feb 2011 12:33:35 +0000 (23:03 +1030)]
failtest: capture pread/pwrite

9 years agofailtest: handle 2-argument open()
Rusty Russell [Tue, 15 Feb 2011 12:33:24 +0000 (23:03 +1030)]
failtest: handle 2-argument open()

9 years agofailtest: fcntl handling
Rusty Russell [Tue, 15 Feb 2011 12:33:06 +0000 (23:03 +1030)]
failtest: fcntl handling

Catch fcntl, particularly fcntl locks.

9 years agoccanlint: print coverage amount when -vv
Rusty Russell [Thu, 17 Feb 2011 23:54:17 +0000 (10:24 +1030)]
ccanlint: print coverage amount when -vv

9 years agoccanlint: fix format error when test output contains %
Rusty Russell [Thu, 17 Feb 2011 23:54:01 +0000 (10:24 +1030)]
ccanlint: fix format error when test output contains %

9 years agonet: reset slen properly in testing.
Rusty Russell [Tue, 22 Feb 2011 04:55:54 +0000 (15:25 +1030)]
net: reset slen properly in testing.

9 years agonet: fix tests on hosts where 'localhost' is v4 _and_ v6
Sam Vilain [Tue, 22 Feb 2011 04:56:36 +0000 (15:26 +1030)]
net: fix tests on hosts where 'localhost' is v4 _and_ v6
If 'localhost' exists in /etc/hosts with a v4 and a v6 address, the hack
which joins two addrinfo entries together is not necessary.  Detect to see
if 'localhost' returned a v6 address, and if so, just return the single
linked list result from getaddrinfo()

(Reworked by Rusty Russell)
Signed-off-by: Sam Vilain <sam@vilain.net>
9 years agoopt: Add a function to free the internal memory.
Andreas Schlick [Thu, 17 Feb 2011 21:58:44 +0000 (22:58 +0100)]
opt: Add a function to free the internal memory.

9 years agoopt: Correct the separator in _info's example.
Andreas Schlick [Thu, 17 Feb 2011 21:50:07 +0000 (22:50 +0100)]
opt: Correct the separator in _info's example.

9 years agoccanlint: recognise new BSD 3-clause license.
Rusty Russell [Tue, 22 Feb 2011 03:35:51 +0000 (14:05 +1030)]
ccanlint: recognise new BSD 3-clause license.

9 years agolicenses: clarify which BSD license it is.
Rusty Russell [Tue, 22 Feb 2011 03:33:15 +0000 (14:03 +1030)]
licenses: clarify which BSD license it is.

9 years agoMerge branch 'daemon-with-notify' of git://github.com/stewartsmith/ccan into daemon...
Rusty Russell [Tue, 22 Feb 2011 02:14:45 +0000 (12:44 +1030)]
Merge branch 'daemon-with-notify' of git://github.com/stewartsmith/ccan into daemon-with-notify

9 years agoweb: delete unused tool binaries.
Rusty Russell [Fri, 18 Feb 2011 10:36:59 +0000 (21:06 +1030)]
web: delete unused tool binaries.

9 years agomove daemon-with-notify to daemon_with_notify as dashes aren't allowed in CCAN module...
Stewart Smith [Fri, 11 Feb 2011 01:06:24 +0000 (12:06 +1100)]
move daemon-with-notify to daemon_with_notify as dashes aren't allowed in CCAN module names (and ccanlint segfaults on them)

9 years agofix up daemon-with-notify test
Stewart Smith [Fri, 11 Feb 2011 01:00:25 +0000 (12:00 +1100)]
fix up daemon-with-notify test

9 years agocan't use C comments in C comments - DUH
Stewart Smith [Fri, 11 Feb 2011 00:25:25 +0000 (11:25 +1100)]
can't use C comments in C comments - DUH

9 years agoupdate include to match header name conforming to CCAN standard
Stewart Smith [Fri, 11 Feb 2011 00:23:04 +0000 (11:23 +1100)]
update include to match header name conforming to CCAN standard

9 years agorename source to match CCAN standards
Stewart Smith [Fri, 11 Feb 2011 00:22:25 +0000 (11:22 +1100)]
rename source to match CCAN standards

9 years agoupdate test case copied from daemonize to use some of daemon-with-notify features
Stewart Smith [Fri, 11 Feb 2011 00:17:44 +0000 (11:17 +1100)]
update test case copied from daemonize to use some of daemon-with-notify features

9 years agofix function declaration for daemon_is_ready()
Stewart Smith [Fri, 11 Feb 2011 00:17:08 +0000 (11:17 +1100)]
fix function declaration for daemon_is_ready()

9 years agouse proper include path for daemon.h
Stewart Smith [Fri, 11 Feb 2011 00:13:37 +0000 (11:13 +1100)]
use proper include path for daemon.h

9 years agoadd daemon.h and documentation on functions
Stewart Smith [Fri, 11 Feb 2011 00:12:27 +0000 (11:12 +1100)]
add daemon.h and documentation on functions

9 years agoremove ident headers from daemon-with-notify/daemon.c
Stewart Smith [Fri, 11 Feb 2011 00:03:07 +0000 (11:03 +1100)]
remove ident headers from daemon-with-notify/daemon.c

9 years agoadd basic bit of daemon-with-notify (mostly just from the Drizzle tree)
Stewart Smith [Thu, 10 Feb 2011 23:53:25 +0000 (10:53 +1100)]
add basic bit of daemon-with-notify (mostly just from the Drizzle tree)

9 years agoopt: Silence unsed param warning triggered by -Wextra
Joel Stanley [Mon, 7 Feb 2011 04:06:16 +0000 (14:36 +1030)]
opt: Silence unsed param warning triggered by -Wextra

The type checking function does not use its parameter:

    ccan/opt/opt.h: In function ‘_check_is_entry’:
        ccan/opt/opt.h:328:53: warning: unused parameter ‘e’

Annotate the function using UNUSED from compiler.h.  This commit also
adds compiler.h as a dependency for opt.

9 years agoopt: Fix -Wmissing-field-initializers warning
Joel Stanley [Mon, 7 Feb 2011 04:06:15 +0000 (14:36 +1030)]
opt: Fix -Wmissing-field-initializers warning

OPT_ENDTABLE does not initalise all the elements in stuct opt_table.
When compliling with -Wextra -Wmissing-field-initializers is enabled,
which produces the following warning:

        iviewiir.c:299:9: error: missing field 'cb' initializer
              [-Wmissing-field-initializers]
                OPT_ENDTABLE
                ^
        In file included from iviewiir.c:12:
        ./ccan/opt/opt.h:82:38: note: instantiated from:
        #define OPT_ENDTABLE { NULL, OPT_END }
                                             ^
By changing the definition of OPT_ENDTABLE to initalise all 7 elements
of struct opt_table, the warning is silenced.