Skip to contentSkip to conversation

check for PR_SET_NAME being defined

PATCH In review Nathan Froyd 2 participants 3 messages Jul 21, 2009 – Jul 22, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check for PR_SET_NAME being defined

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.

---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
vl.c +1 -1
index ce213c2..61f7711 100644
@@ -310,7 +310,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;
Signature · 1 line
1.6.2.4
#1 lore raw
Quoted 4 lines · Nathan Froyd

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.

Needs a Signed-off-by.

Regards,

Anthony Liguori

#2 lore raw

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.

---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

[...thought format.signoff would work in all cases, but apparently not...]

vl.c +1 -1
index ce213c2..61f7711 100644
@@ -310,7 +310,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;
Signature · 1 line
1.6.2.4