Jeroen Ketema [Thu, 19 Nov 2009 12:22:18 +0000 (13:22 +0100)]
Signed-off-by: Michael Weber <michaelw@foldr.org>

dragonfly.c
freebsd.c
netbsd.c

index da5ceaf..ace7a61 100644 (file)
@@ -48,7 +48,7 @@ pid_t sampling_fork()
      switch (pid) {
      case -1:
      case 0:
-          return 0;
+          return pid;
      default:
          pagesize = sysconf(_SC_PAGESIZE);
          kd = kvm_openfiles(_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY,
index 4626b73..9ad6d8e 100644 (file)
--- a/freebsd.c
+++ b/freebsd.c
@@ -48,7 +48,7 @@ pid_t sampling_fork()
      switch (pid) {
      case -1:
      case 0:
-          return 0;
+          return pid;
      default:
          pagesize = getpagesize();
          kd = kvm_openfiles(_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY,
index 4b01f23..fbfba04 100644 (file)
--- a/netbsd.c
+++ b/netbsd.c
@@ -44,7 +44,7 @@ pid_t sampling_fork()
      switch (pid) {
      case -1:
      case 0:
-          return 0;
+          return pid;
      default:
          pagesize = sysconf(_SC_PAGESIZE);
          kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, NULL);