summaryrefslogtreecommitdiff
path: root/src/fl_open_uri.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-11 19:14:47 +0000
committerManolo Gouy <Manolo>2016-04-11 19:14:47 +0000
commit64b3d26daa983b7a1394c82b080068cb1a056950 (patch)
tree543a65106a8057c7560e7ecf807ee2d140ee8660 /src/fl_open_uri.cxx
parent1411c119058743cd1b5ae68f8d076f11b9f85c10 (diff)
Create Fl_X11_System_Driver.{cxx,.H} and share Fl_Posix_System_Driver.{cxx,.H} between Darwin and USE_X11 platforms.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11583 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_open_uri.cxx')
-rw-r--r--src/fl_open_uri.cxx32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/fl_open_uri.cxx b/src/fl_open_uri.cxx
index 721158dc2..d2a4d9f34 100644
--- a/src/fl_open_uri.cxx
+++ b/src/fl_open_uri.cxx
@@ -27,7 +27,6 @@
#include "config_lib.h"
#include <FL/filename.H>
#include <FL/Fl.H>
-#include <FL/Fl_System_Driver.H>
#include <stdio.h>
#include <stdlib.h>
#include "flstring.h"
@@ -130,8 +129,9 @@ void fl_decode_uri(char *uri)
/** @} */
-#if defined(FL_CFG_GFX_XLIB) || defined(FL_CFG_GFX_QUARTZ)
+#if defined(FL_CFG_SYS_POSIX)
// code shared by the Mac OS and USE_X11 platforms
+# include "drivers/Posix/Fl_Posix_System_Driver.H"
# include <unistd.h>
# include <sys/wait.h>
# include <signal.h>
@@ -139,7 +139,7 @@ void fl_decode_uri(char *uri)
# include <errno.h>
// Run the specified program, returning 1 on success and 0 on failure
-static int run_program(const char *program, char **argv, char *msg, int msglen) {
+int Fl_Posix_System_Driver::run_program(const char *program, char **argv, char *msg, int msglen) {
pid_t pid; // Process ID of first child
int status; // Exit status from first child
sigset_t set, oldset; // Signal masks
@@ -163,13 +163,13 @@ static int run_program(const char *program, char **argv, char *msg, int msglen)
if (!fork()) {
// Second child comes here, redirect stdin/out/err to /dev/null...
close(0);
- open("/dev/null", O_RDONLY);
+ ::open("/dev/null", O_RDONLY);
close(1);
- open("/dev/null", O_WRONLY);
+ ::open("/dev/null", O_WRONLY);
close(2);
- open("/dev/null", O_WRONLY);
+ ::open("/dev/null", O_WRONLY);
// Detach from the current process group...
setsid();
@@ -210,26 +210,8 @@ static int run_program(const char *program, char **argv, char *msg, int msglen)
// Return indicating success...
return 1;
}
-#endif
+#endif // FL_CFG_SYS_POSIX
-#if defined(FL_CFG_GFX_QUARTZ)
-
-#include "drivers/Darwin/Fl_Darwin_System_Driver.H"
-
-int Fl_Darwin_System_Driver::run_program(const char *program, char **argv, char *msg, int msglen)
-{
- return ::run_program(program, argv, msg, msglen);
-}
-
-#elif defined(FL_CFG_GFX_XLIB)
-#include "drivers/Posix/Fl_Posix_System_Driver.H"
-
-int Fl_Posix_System_Driver::run_program(const char *program, char **argv, char *msg, int msglen)
-{
- return ::run_program(program, argv, msg, msglen);
-}
-
-#endif
#ifdef TEST
//