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

Proposed by Cameron Norman on 2014-08-05
Status: Merged
Merged at revision: 765
Proposed branch: lp:~elementary-dev-community/granite/fix-1324424
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 53 lines (+18/-2)
2 files modified
CMakeLists.txt (+10/-2)
lib/Application.vala (+8/-0)
To merge this branch: bzr merge lp:~elementary-dev-community/granite/fix-1324424
Reviewer Review Type Date Requested Status
xapantu (community) 2014-08-05 Approve on 2014-08-05
Review via email: mp+229547@code.launchpad.net

Description of the change

This patch just uses some ifdefs to use setproctitle instead of prctl on *BSD systems.

To post a comment you must log in.
Cameron Norman (cameronnemo) wrote :

I should mention that the original author is Olivier Duchateau, I just applied his patch to a recent granite to make it easier to merge for you guys.

xapantu (xapantu) wrote :

It looks fine - thanks for your work. I didn't test the *BSD part, I assume that you or Olivier Duchateau tested it.

I am going to merge this with an upper case style (i.e DRAGON_FLY instead of DragonFly).

review: Approve
Raphael Isemann (teemperor) wrote :

I don't think we can actually test it on all platforms such as FreeBSD because they don't have the necessary version of some libs (vala and GTK+ for example). It doesn't break anything on elementary OS so +1 for merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-03-05 16:53:25 +0000
3+++ CMakeLists.txt 2014-08-05 02:36:33 +0000
4@@ -61,12 +61,20 @@
5 --thread
6 --target-glib=2.32)
7
8-if (CMAKE_SYSTEM_NAME MATCHES "Linux")
9+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
10 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=LINUX)
11+elseif (${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
12+ set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=DragonFly)
13+elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
14+ set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=FreeBSD)
15+elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
16+ set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=NetBSD)
17+elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
18+ set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=OpenBSD)
19 endif ()
20
21 add_subdirectory (lib)
22 add_subdirectory (demo)
23 add_subdirectory (doc)
24 add_subdirectory (po)
25-add_subdirectory (icons)
26\ No newline at end of file
27+add_subdirectory (icons)
28
29=== modified file 'lib/Application.vala'
30--- lib/Application.vala 2014-04-19 15:06:36 +0000
31+++ lib/Application.vala 2014-08-05 02:36:33 +0000
32@@ -145,6 +145,8 @@
33 public Application () {
34 #if LINUX
35 prctl (15, exec_name, 0, 0, 0);
36+#elif DragonFly || FreeBSD || NetBSD || OpenBSD
37+ setproctitle (exec_name);
38 #endif
39 Environment.set_prgname (exec_name);
40
41@@ -166,6 +168,12 @@
42 #if LINUX
43 [CCode (cheader_filename = "sys/prctl.h", cname = "prctl")]
44 protected extern static int prctl (int option, string arg2, ulong arg3, ulong arg4, ulong arg5);
45+#elif DragonFly || FreeBSD
46+ [CCode (cheader_filename = "unistd.h", cname = "setproctitle")]
47+ protected extern static void setproctitle (string fmt, ...);
48+#elif NetBSD || OpenBSD
49+ [CCode (cheader_filename = "stdlib.h", cname = "setproctitle")]
50+ protected extern static void setproctitle (string fmt, ...);
51 #endif
52
53 /**

Subscribers

People subscribed via source and target branches