From c9f68e79b98a431e0314a40dab05dfd498fc7dea Mon Sep 17 00:00:00 2001
From: Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
Date: Mon, 19 May 2014 19:58:05 +0200
Subject: [PATCH] native: set _native_pid correctly in daemon mode

This fixes a bug that leads to all unix sockets being created as
`/tmp/riot.tty.0`.
---
 cpu/native/startup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpu/native/startup.c b/cpu/native/startup.c
index b7c2c6bc5d..821e6c67c4 100644
--- a/cpu/native/startup.c
+++ b/cpu/native/startup.c
@@ -146,6 +146,9 @@ void daemonize(void)
         real_printf("RIOT pid: %d\n", _native_pid);
         exit(EXIT_SUCCESS);
     }
+    else {
+        _native_pid = real_getpid();
+    }
 }
 
 void usage_exit(void)
-- 
GitLab