diff options
author | Guillem Jover <guillem@debian.org> | 2011-03-16 14:22:34 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2011-04-02 02:38:09 +0200 |
commit | ba372a8c554dfe6fa4f0e12961efab6b10aaf6bd (patch) | |
tree | 7b39cd5b13cb0139bbe2a3e2f4ea4fa66545cc42 /dpkg-split/queue.c | |
parent | f6600ffa162e6f2f04f6a10d9622bee3bc8781a1 (diff) | |
download | dpkg-ba372a8c554dfe6fa4f0e12961efab6b10aaf6bd.tar.gz |
Make all command line action functions return int
This will allow using type-safe function pointers instead of casting
them around. Replace all exit(3) calls with return statements. Remove
DPKG_ATTR_NORET from function declarations, all functions are expected
to return now.
Diffstat (limited to 'dpkg-split/queue.c')
-rw-r--r-- | dpkg-split/queue.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/dpkg-split/queue.c b/dpkg-split/queue.c index 0f6488c2b..8f221c7c3 100644 --- a/dpkg-split/queue.c +++ b/dpkg-split/queue.c @@ -120,7 +120,9 @@ partmatches(struct partinfo *pi, struct partinfo *refi) pi->maxpartlen == refi->maxpartlen); } -void do_auto(const char *const *argv) { +int +do_auto(const char *const *argv) +{ const char *partfile; struct partinfo *refi, **partlist, *otherthispart; struct partqueue *pq; @@ -140,7 +142,7 @@ void do_auto(const char *const *argv) { if (!opt_npquiet) printf(_("File `%.250s' is not part of a multipart archive.\n"),partfile); m_output(stdout, _("<standard output>")); - exit(1); + return 1; } fclose(part); scandepot(); @@ -214,9 +216,13 @@ void do_auto(const char *const *argv) { } m_output(stderr, _("<standard error>")); + + return 0; } -void do_queue(const char *const *argv) { +int +do_queue(const char *const *argv) +{ struct partqueue *pq; const char *head; struct stat stab; @@ -272,6 +278,8 @@ void do_queue(const char *const *argv) { printf(_("(total %jd bytes)\n"), (intmax_t)bytes); } m_output(stdout, _("<standard output>")); + + return 0; } enum discardwhich { ds_junk, ds_package, ds_all }; @@ -298,7 +306,9 @@ static void discardsome(enum discardwhich which, const char *package) { } } -void do_discard(const char *const *argv) { +int +do_discard(const char *const *argv) +{ const char *thisarg; struct partqueue *pq; @@ -312,4 +322,6 @@ void do_discard(const char *const *argv) { } else { discardsome(ds_all,NULL); } + + return 0; } |