← Back to team overview

elementary-dev-community team mailing list archive

[Merge] lp:~elementary-dev-community/granite/fix-1324424 into lp:granite

 

Cameron Norman has proposed merging lp:~elementary-dev-community/granite/fix-1324424 into lp:granite.

Requested reviews:
  elementary Pantheon team (elementary-pantheon)
Related bugs:
  Bug #1324424 in Granite: "Support BSD systems, prctl () -> setproctitle ()"
  https://bugs.launchpad.net/granite/+bug/1324424

For more details, see:
https://code.launchpad.net/~elementary-dev-community/granite/fix-1324424/+merge/229547

This patch just uses some ifdefs to use setproctitle instead of prctl on *BSD systems.
-- 
https://code.launchpad.net/~elementary-dev-community/granite/fix-1324424/+merge/229547
Your team elementary Developer Community is subscribed to branch lp:~elementary-dev-community/granite/fix-1324424.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2014-03-05 16:53:25 +0000
+++ CMakeLists.txt	2014-08-05 02:36:33 +0000
@@ -61,12 +61,20 @@
      --thread
      --target-glib=2.32)
 
-if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=LINUX)
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
+    set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=DragonFly)
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+    set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=FreeBSD)
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+    set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=NetBSD)
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
+    set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=OpenBSD)
 endif ()
 
 add_subdirectory (lib)
 add_subdirectory (demo)
 add_subdirectory (doc)
 add_subdirectory (po)
-add_subdirectory (icons)
\ No newline at end of file
+add_subdirectory (icons)

=== modified file 'lib/Application.vala'
--- lib/Application.vala	2014-04-19 15:06:36 +0000
+++ lib/Application.vala	2014-08-05 02:36:33 +0000
@@ -145,6 +145,8 @@
         public Application () {
 #if LINUX
             prctl (15, exec_name, 0, 0, 0);
+#elif DragonFly || FreeBSD || NetBSD || OpenBSD
+            setproctitle (exec_name);
 #endif
             Environment.set_prgname (exec_name);
 
@@ -166,6 +168,12 @@
 #if LINUX
         [CCode (cheader_filename = "sys/prctl.h", cname = "prctl")]
             protected extern static int prctl (int option, string arg2, ulong arg3, ulong arg4, ulong arg5);
+#elif DragonFly || FreeBSD
+        [CCode (cheader_filename = "unistd.h", cname = "setproctitle")]
+            protected extern static void setproctitle (string fmt, ...);
+#elif NetBSD || OpenBSD
+        [CCode (cheader_filename = "stdlib.h", cname = "setproctitle")]
+            protected extern static void setproctitle (string fmt, ...);
 #endif
 
         /**


Follow ups