RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 14-Jul-2017 17:38:36 Branch: rpm-5_4 Handle: 2017071415383600 Modified files: (Branch: rpm-5_4) rpm/rpmio rpmsq.c Log: - use macro __VA_ARGS__. Summary: Revision Changes Path 1.42.6.12 +13 -11 rpm/rpmio/rpmsq.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/rpmio/rpmsq.c ============================================================================ $ cvs diff -u -r1.42.6.11 -r1.42.6.12 rpmsq.c --- rpm/rpmio/rpmsq.c 20 May 2017 13:42:49 -0000 1.42.6.11 +++ rpm/rpmio/rpmsq.c 14 Jul 2017 15:38:36 -0000 1.42.6.12 @@ -160,7 +160,9 @@ #include "debug.h" int _rpmsq_debug; -#define SPEW(_list) if (_rpmsq_debug) fprintf _list +#define SPEW(_fmt, ...) \ + if (_rpmsq_debug) \ + fprintf(stderr, _fmt, __VA_ARGS__) /* XXX __OpenBSD__ insque(3) needs rock->q_forw initialized. */ static struct rpmsqElem rpmsqRock = { &rpmsqRock, NULL }; @@ -173,7 +175,7 @@ int ret = -1; if (sq != NULL) { -SPEW((stderr, " Insert(%p): %p\n", ME(), sq)); +SPEW(" Insert(%p): %p\n", ME(), sq); ret = sighold(SIGCHLD); if (ret == 0) { sq->child = 0; @@ -199,7 +201,7 @@ if (elem != NULL) { if (_rpmsq_debug) -SPEW((stderr, " Remove(%p): %p\n", ME(), sq)); +SPEW(" Remove(%p): %p\n", ME(), sq); ret = sighold (SIGCHLD); if (ret == 0) { _rpm_remque(elem); @@ -362,7 +364,7 @@ if (sq->reaper) { xx = rpmsqInsert(sq, NULL); -SPEW((stderr, " Enable(%p): %p\n", ME(), sq)); +SPEW(" Enable(%p): %p\n", ME(), sq); xx = rpmsqEnable(SIGCHLD, NULL); } @@ -387,13 +389,13 @@ xx = close(sq->pipes[0]); sq->pipes[0] = sq->pipes[1] = -1; -SPEW((stderr, " Child(%p): %p child %d\n", ME(), sq, (int)getpid())); +SPEW(" Child(%p): %p child %d\n", ME(), sq, (int)getpid()); } else { /* Parent. */ sq->child = pid; -SPEW((stderr, " Parent(%p): %p child %d\n", ME(), sq, (int)sq->child)); +SPEW(" Parent(%p): %p child %d\n", ME(), sq, (int)sq->child); } @@ -453,14 +455,14 @@ xx = sigrelse(SIGCHLD); -SPEW((stderr, " Wake(%p): %p child %d reaper %d ret %d\n", ME(), sq, (int)sq->child, sq->reaper, ret)); +SPEW(" Wake(%p): %p child %d reaper %d ret %d\n", ME(), sq, (int)sq->child, sq->reaper, ret); /* Remove processed SIGCHLD item from queue. */ xx = rpmsqRemove(sq); /* Disable SIGCHLD handler on refcount == 0. */ xx = rpmsqEnable(-SIGCHLD, NULL); -SPEW((stderr, " Disable(%p): %p\n", ME(), sq)); +SPEW(" Disable(%p): %p\n", ME(), sq); return ret; } @@ -468,7 +470,7 @@ pid_t rpmsqWait(rpmsq sq) { -SPEW((stderr, " Wait(%p): %p child %d reaper %d\n", ME(), sq, (int)sq->child, sq->reaper)); +SPEW(" Wait(%p): %p child %d reaper %d\n", ME(), sq, (int)sq->child, sq->reaper); if (sq->reaper) { (void) rpmsqWaitUnregister(sq); @@ -480,10 +482,10 @@ } while (reaped >= 0 && reaped != sq->child); sq->reaped = reaped; sq->status = status; -SPEW((stderr, " Waitpid(%p): %p child %d reaped %d\n", ME(), sq, (int)sq->child, (int)sq->reaped)); +SPEW(" Waitpid(%p): %p child %d reaped %d\n", ME(), sq, (int)sq->child, (int)sq->reaped); } -SPEW((stderr, " Fini(%p): %p child %d status 0x%x\n", ME(), sq, (int)sq->child, sq->status)); +SPEW(" Fini(%p): %p child %d status 0x%x\n", ME(), sq, (int)sq->child, sq->status); return sq->reaped; } @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
