From f58973cb6e8c82d8970602c70dd99d0e1c19335a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 1 Jan 2016 20:43:23 +0100 Subject: remove satd-rm and satd-r and let satrm and satr do everything (not done yet) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/satq.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/satq.c') 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; } -- cgit v1.2.3-70-g09d2