Debian Codegraph @

debian/patches/sparc-clone-lockup

raw
1 --- a/dump/tape.c
2 +++ b/dump/tape.c
3 @@ -696,7 +696,24 @@ rollforward(void)
4 pid_t
5 fork_clone_io(void)
6 {
7 - return syscall(SYS_clone, CLONE_ARGS);
8 + pid_t res,parent;
9 + parent=getppid(); /* az hackety hack... */
10 +
11 + res=syscall(SYS_clone, CLONE_ARGS);
12 + getppid();
13 + /* as per clone call manpage: caching! */
14 + getpid();
15 +#ifdef __alpha__
16 + syscall(SYS_getxpid);
17 +#else
18 + syscall(SYS_getpid);
19 +#endif
20 +
21 + /* az: clone manpage doesn't say jack about what the
22 + child receives, but it's NOT ZERO on sparc. however, it seems the
23 + ppid is updated and trustworthy - so let's use that... */
24 + return parent==getppid()?res:0;
25 +
26 }
27 #endif
28