Patchwork check for PR_SET_NAME being defined

login
register
mail settings
Submitter Nathan Froyd
Date Aug. 3, 2009, 2:32 p.m.
Message ID <1249309932-4549-1-git-send-email-froydnj@codesourcery.com>
Download mbox | patch
Permalink /patch/30593/
State Superseded
Headers show

Comments

Nathan Froyd - Aug. 3, 2009, 2:32 p.m.
Depending on what glibc/kernel headers you are compiling against,
PR_SET_NAME may or may not be defined.  Do the right thing if
PR_SET_NAME isn't defined and skip setting the process name.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

v2: resent, including Signed-off-by this time.

Patch

diff --git a/vl.c b/vl.c
index fdd4f03..0f07ca9 100644
--- a/vl.c
+++ b/vl.c
@@ -300,7 +300,7 @@  void hw_error(const char *fmt, ...)
 
 static void set_proc_name(const char *s)
 {
-#ifdef __linux__
+#if defined(__linux__) && defined(PR_SET_NAME)
     char name[16];
     if (!s)
         return;