Rather than execve()'ing a second process when it is detected that pkg needs to be re-run, fork the process early-on, let the forked child run, and do whatever wrk is required and signal back to the parent by setting its exit status if it needs to be restarted.
modified libpkg/pkg.h.in
@@ -38,6 +38,7 @@
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -65,6 +66,12 @@
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified src/main.c
@@ -65,7 +65,6 @@ static void usage(const char *, const char *, FILE *, enum pkg_usage_reason, ...
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -483,7 +482,6 @@ main(int argc, char **argv)
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -731,10 +729,8 @@ main(int argc, char **argv)
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|