diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-31 03:31:06 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-31 03:31:06 +0100 |
commit | 5c6f9566ec7f8f0a0066cf423d63a7bdc0d7e599 (patch) | |
tree | bd3729623e8600d53cc366f41e61b0b21e73a1b2 /src/daemon.h | |
parent | some improvements and fixes (diff) | |
download | sat-5c6f9566ec7f8f0a0066cf423d63a7bdc0d7e599.tar.gz sat-5c6f9566ec7f8f0a0066cf423d63a7bdc0d7e599.tar.bz2 sat-5c6f9566ec7f8f0a0066cf423d63a7bdc0d7e599.tar.xz |
fix bugs and improve debugging
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/daemon.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/daemon.h b/src/daemon.h index c36e314..567e268 100644 --- a/src/daemon.h +++ b/src/daemon.h @@ -55,6 +55,11 @@ */ #define REAL_FILENO 6 +/** + * The file descriptor for the lock file. + */ +#define LOCK_FILENO 7 + /** * Command: queue a job. @@ -84,7 +89,13 @@ * * @param ... The statement. */ -# define t(...) do { if (__VA_ARGS__) goto fail; } while (0) +# ifdef DEBUG +# define t(...) do { if ((__VA_ARGS__) ? (failed__ = #__VA_ARGS__) : 0) { (perror)(failed__); goto fail; } } while (0) +static const char *failed__ = NULL; +# define perror(_) ((void)(_)) +# else +# define t(...) do { if (__VA_ARGS__) goto fail; } while (0) +# endif #endif |