$OpenBSD: patch-src_ptlib_unix_svcproc_cxx,v 1.3 2017/05/07 20:48:29 espie Exp $
--- src/ptlib/unix/svcproc.cxx.orig	Fri Apr 28 01:32:32 2017
+++ src/ptlib/unix/svcproc.cxx	Fri Apr 28 01:41:06 2017
@@ -66,6 +66,7 @@
 #include <sys/resource.h>
 #endif
 
+#include <unistd.h>
 
 // Doesn't everybody have this?
 #ifndef _PATH_VARRUN
@@ -279,7 +280,8 @@ int PServiceProcess::InitialiseService()
     pid_t pid;
 
     {
-      ifstream pidfile(pidfilename);
+      const char *tmp = pidfilename;
+      ifstream pidfile(tmp);
       if (!pidfile.is_open()) {
         cout << "Could not open pid file: \"" << pidfilename << "\""
                 " - " << strerror(errno) << endl;
@@ -422,7 +424,8 @@ int PServiceProcess::InitialiseService()
   // Run as a daemon, ie fork
 
   if (!pidfilename) {
-    ifstream pidfile(pidfilename);
+    const char *tmp = pidfilename;
+    ifstream pidfile(tmp);
     if (pidfile.is_open()) {
       pid_t pid;
       pidfile >> pid;
@@ -450,7 +453,8 @@ int PServiceProcess::InitialiseService()
       cout << "Daemon started with pid " << pid << endl;
       if (!pidfilename) {
         // Write out the child pid to magic file in /var/run (at least for linux)
-        ofstream pidfile(pidfilename);
+	const char *tmp = pidfilename;
+        ofstream pidfile(tmp);
         if (pidfile.is_open())
           pidfile << pid;
         else
