aboutsummaryrefslogtreecommitdiffstats
path: root/src/cg-negative.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-05 00:27:00 +0200
committerMattias Andrée <maandree@kth.se>2016-08-05 00:27:00 +0200
commitc3d835ee0963d433c451e6233e88eadc245369b8 (patch)
tree48605d31f87fca9102b5b5ebc9c5d79e426c44c3 /src/cg-negative.c
parentFixes to cg-base and work on cg-negative (diff)
downloadcg-tools-c3d835ee0963d433c451e6233e88eadc245369b8.tar.gz
cg-tools-c3d835ee0963d433c451e6233e88eadc245369b8.tar.bz2
cg-tools-c3d835ee0963d433c451e6233e88eadc245369b8.tar.xz
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/cg-negative.c')
-rw-r--r--src/cg-negative.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cg-negative.c b/src/cg-negative.c
index 566b81a..b0c19ed 100644
--- a/src/cg-negative.c
+++ b/src/cg-negative.c
@@ -30,7 +30,7 @@
/**
* The default filter priority for the program
*/
-const int64_t default_priority = ((int64_t)1) << 62;
+const int64_t default_priority = ((int64_t)1) << 63;
/**
* The default class for the program
@@ -151,13 +151,13 @@ int handle_opt(char* opt, char* arg)
int handle_args(int argc, char* argv[], char* method, char* site,
char** crtcs, char* prio, char* rule)
{
- int q = dflag + (xflag | rplus | gplus | bplus);
+ int q = xflag + (dflag | rplus | gplus | bplus);
q += (method != NULL) && !strcmp(method, "?");
q += (prio != NULL) && !strcmp(prio, "?");
- q += (rule != NULL) && (!strcmp(method, "?") || !strcmp(method, "??"));
+ q += (rule != NULL) && (!strcmp(rule, "?") || !strcmp(rule, "??"));
for (; *crtcs; crtcs++)
q += !strcmp(*crtcs, "?");
- if (argc || q || (dflag && (prio != NULL)))
+ if (argc || (q > 1) || (xflag && (prio != NULL)))
usage();
}
@@ -229,12 +229,14 @@ int start(void)
}
while (r != 1)
- if ((r = update_filter(i, -1)) < 0)
+ if ((r = synchronise(-1)) < 0)
return r;
if (!dflag)
return 0;
+ if (libcoopgamma_set_nonblocking(&cg, 0) < 0)
+ return -1;
for (;;)
if (libcoopgamma_synchronise(&cg, NULL, 0, &j) < 0)
switch (errno)