From d0e1e07ca85c43b417fd3ec83078060fb7bba405 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 4 Jun 2008 04:00:41 +0300 Subject: [PATCH] dpkg: Fix the support for passing more than one --status-fd option Until now only the last one was being used. --- ChangeLog | 4 ++++ debian/changelog | 2 ++ src/main.c | 16 ++++++---------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad6da428..694ed8b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-06-04 Guillem Jover + + * src/main.c (setpipe): Fix the setting of more than one pipef. + 2008-06-04 Guillem Jover * src/select.c (setselections): Free varbuf variables. diff --git a/debian/changelog b/debian/changelog index 041413fc..b47322fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ dpkg (1.15.0) UNRELEASED; urgency=low * Remove duplicate program name from dpkg-trigger badusage output. * Trim trailing slash and slash dot from 'dpkg -S' arguments when those are path names, but not on patterns. Closes: #129577 + * Fix the support for passing more than one --status-fd option to dpkg. + Until now only the last one was being used. [ Raphael Hertzog ] * Enhance dpkg-shlibdeps's error message when a library can't be found to diff --git a/src/main.c b/src/main.c index 00b05440..d92210a7 100644 --- a/src/main.c +++ b/src/main.c @@ -291,7 +291,8 @@ static void setinteger(const struct cmdinfo *cip, const char *value) { } static void setpipe(const struct cmdinfo *cip, const char *value) { - static struct pipef **lastpipe; + struct pipef **pipe_head = cip->parg; + struct pipef *pipe_new; unsigned long v; char *ep; @@ -299,15 +300,10 @@ static void setpipe(const struct cmdinfo *cip, const char *value) { if (*ep || v > INT_MAX) badusage(_("invalid integer for --%s: `%.250s'"),cip->olong,value); - lastpipe= cip->parg; - if (*lastpipe) { - (*lastpipe)->next= nfmalloc(sizeof(struct pipef)); - *lastpipe= (*lastpipe)->next; - } else { - *lastpipe= nfmalloc(sizeof(struct pipef)); - } - (*lastpipe)->fd= v; - (*lastpipe)->next= NULL; + pipe_new = nfmalloc(sizeof(struct pipef)); + pipe_new->fd = v; + pipe_new->next = *pipe_head; + *pipe_head = pipe_new; } static void setforce(const struct cmdinfo *cip, const char *value) { -- 2.39.5