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

Proposed by Cameron Norman
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) Approve
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.
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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
=== 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 @@
61 --thread61 --thread
62 --target-glib=2.32)62 --target-glib=2.32)
6363
64if (CMAKE_SYSTEM_NAME MATCHES "Linux")64if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
65 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=LINUX)65 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=LINUX)
66elseif (${CMAKE_SYSTEM_NAME} MATCHES "DragonFly")
67 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=DragonFly)
68elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
69 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=FreeBSD)
70elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
71 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=NetBSD)
72elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
73 set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=OpenBSD)
66endif ()74endif ()
6775
68add_subdirectory (lib)76add_subdirectory (lib)
69add_subdirectory (demo)77add_subdirectory (demo)
70add_subdirectory (doc)78add_subdirectory (doc)
71add_subdirectory (po)79add_subdirectory (po)
72add_subdirectory (icons)
73\ No newline at end of file80\ No newline at end of file
81add_subdirectory (icons)
7482
=== 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 @@
145 public Application () {145 public Application () {
146#if LINUX146#if LINUX
147 prctl (15, exec_name, 0, 0, 0);147 prctl (15, exec_name, 0, 0, 0);
148#elif DragonFly || FreeBSD || NetBSD || OpenBSD
149 setproctitle (exec_name);
148#endif150#endif
149 Environment.set_prgname (exec_name);151 Environment.set_prgname (exec_name);
150152
@@ -166,6 +168,12 @@
166#if LINUX168#if LINUX
167 [CCode (cheader_filename = "sys/prctl.h", cname = "prctl")]169 [CCode (cheader_filename = "sys/prctl.h", cname = "prctl")]
168 protected extern static int prctl (int option, string arg2, ulong arg3, ulong arg4, ulong arg5);170 protected extern static int prctl (int option, string arg2, ulong arg3, ulong arg4, ulong arg5);
171#elif DragonFly || FreeBSD
172 [CCode (cheader_filename = "unistd.h", cname = "setproctitle")]
173 protected extern static void setproctitle (string fmt, ...);
174#elif NetBSD || OpenBSD
175 [CCode (cheader_filename = "stdlib.h", cname = "setproctitle")]
176 protected extern static void setproctitle (string fmt, ...);
169#endif177#endif
170178
171 /**179 /**

Subscribers

People subscribed via source and target branches