aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lib.h2
-rw-r--r--lib/xwrap.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/lib.h b/lib/lib.h
index 2cb0c07a..e90e79f2 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -322,7 +322,7 @@ void mode_to_string(mode_t mode, char *buf);
char *getbasename(char *name);
void names_to_pid(char **names, int (*callback)(pid_t pid, char *name));
-pid_t xvforkwrap(pid_t pid);
+pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid);
#define XVFORK() xvforkwrap(vfork())
// Wrapper to make xfuncs() return (via longjmp) instead of exiting.
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 611bdb52..2e52d6b4 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -163,7 +163,7 @@ void xflush(void)
// share a stack, so child returning from a function would stomp the return
// address parent would need. Solution: make vfork() an argument so processes
// diverge before function gets called.
-pid_t __attribute__((noinline)) xvforkwrap(pid_t pid)
+pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid)
{
if (pid == -1) perror_exit("vfork");