aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-28 12:16:59 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-28 12:16:59 +0100
commitfbc9d99a6a855a1a693fb9c6afaa5705bb9547a6 (patch)
tree919e150ac21b6603ea23f8faf9a6cff3b366aeb7 /src/common.h
parentlisten (diff)
downloadsat-fbc9d99a6a855a1a693fb9c6afaa5705bb9547a6.tar.gz
sat-fbc9d99a6a855a1a693fb9c6afaa5705bb9547a6.tar.bz2
sat-fbc9d99a6a855a1a693fb9c6afaa5705bb9547a6.tar.xz
fix errors + use flock on socket
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r--src/common.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common.h b/src/common.h
index 2f8ac86..55a0837 100644
--- a/src/common.h
+++ b/src/common.h
@@ -48,7 +48,7 @@ usage(void) \
{ \
fprintf(stderr, "usage: %s%s%s\n", \
strrchr(argv0, '/') ? (strrchr(argv0, '/') + 1) : argv0, \
- (synopsis) ? " " : "", synopsis ? synopsis : ""); \
+ synopsis ? " " : "", synopsis ? synopsis : ""); \
exit(2); \
}
@@ -68,12 +68,14 @@ char *argv0 = name;
* that is an option.
*/
#define NO_OPTIONS \
- int i;
+do { \
+ int i; \
if (!strcmp(argv[1], "--")) \
argv++, argc--; \
for (i = 1; i < argc; i++) \
if (strchr("-", argv[i][0])) \
- usage()
+ usage(); \
+} while (0)
/**
@@ -100,7 +102,7 @@ do { \
t (errno); \
free(msg); \
return 3; \
- }
+ } \
} while (0)