aboutsummaryrefslogtreecommitdiffstats
path: root/src/satq.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2016-01-01 20:43:23 +0100
committerMattias Andrée <maandree@member.fsf.org>2016-01-01 20:43:23 +0100
commitf58973cb6e8c82d8970602c70dd99d0e1c19335a (patch)
tree289daeb2d792e5dde602a259f4c854d133fe7cbc /src/satq.c
parentsatq does not interface with satd + fix regression bugs (diff)
downloadsat-f58973cb6e8c82d8970602c70dd99d0e1c19335a.tar.gz
sat-f58973cb6e8c82d8970602c70dd99d0e1c19335a.tar.bz2
sat-f58973cb6e8c82d8970602c70dd99d0e1c19335a.tar.xz
remove satd-rm and satd-r and let satrm and satr do everything (not done yet)
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src/satq.c')
-rw-r--r--src/satq.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/satq.c b/src/satq.c
index f2fef92..c097bfd 100644
--- a/src/satq.c
+++ b/src/satq.c
@@ -247,25 +247,16 @@ main(int argc, char *argv[])
{
struct job **jobs = NULL;
struct job **job;
- int state = -1;
+ PROLOGUE(argc < 2, O_RDONLY, NULL);
- if (argc > 0) argv0 = argv[0];
- if (argc > 1) usage();
-
- GET_FD(state, STATE_FILENO, open_state(O_RDONLY, NULL));
t (!(jobs = get_jobs()));
for (job = jobs; *job; job++)
t (print_job(*job));
- errno = 0;
-fail:
- if (errno)
- perror(argv[0]);
+ CLEANUP_START;
for (job = jobs; jobs && *job; job++)
free(*job);
free(jobs);
- if (state >= 0)
- close(state);
- return !!errno;
+ CLEANUP_END;
}