[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] paxutils/tests/genfile.c port to Solaris 8
From: |
Paul Eggert |
Subject: |
[Bug-tar] paxutils/tests/genfile.c port to Solaris 8 |
Date: |
Tue, 21 Jun 2005 10:39:22 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
I installed this minor change to port genfile.c to Solaris 8.
2005-06-21 Paul Eggert <address@hidden>
* tests/genfile.c: Port to Solaris 8.
Include <signal.h>, for 'signal'.
(SIGCHLD) [! defined SIGCHLD && defined SIGCLD]: Define.
(child_exited, sig_child): Remove; not needed.
(exec_command): Use a prototype.
(main): Set SIGCHLD handler to default, not to sig_child.
And do this only if SIGCHLD is defined. This uses the
same pattern that src/tar.c uses.
--- genfile.c.~1.7.~ 2005-05-14 23:34:49 -0700
+++ genfile.c 2005-06-21 10:36:53 -0700
@@ -23,6 +23,7 @@
*/
#include <system.h>
+#include <signal.h>
#include <stdarg.h>
#include <argmatch.h>
#include <argp.h>
@@ -35,6 +36,10 @@
# define EXIT_FAILURE 1
#endif
+#if ! defined SIGCHLD && defined SIGCLD
+# define SIGCHLD SIGCLD
+#endif
+
#if HAVE_UTIME_H
# include <utime.h>
#else
@@ -575,18 +580,10 @@ process_checkpoint (size_t n)
}
}
-static int child_exited = 0;
-
-RETSIGTYPE
-sig_child (int sig)
-{
- child_exited = 1;
-}
-
#define CHECKPOINT_TEXT "Write checkpoint"
void
-exec_command ()
+exec_command (void)
{
int i, status;
pid_t pid;
@@ -603,7 +600,10 @@ exec_command ()
memmove (exec_argv+2, exec_argv+1, (exec_argc-1)*sizeof (*exec_argv));
exec_argv[1] = "--checkpoint";
- signal (SIGCHLD, sig_child);
+#ifdef SIGCHLD
+ /* System V fork+wait does not work if SIGCHLD is ignored. */
+ signal (SIGCHLD, SIG_DFL);
+#endif
pipe (fd);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-tar] paxutils/tests/genfile.c port to Solaris 8,
Paul Eggert <=