Hi Guys
after 7 weeks of pain, i finally found why kio-slaves from trunk was failling
on FreeBSD.
actually is due a cmake test that it is no founding the setproctitle funtion
on FreeBSD and then not creating the corresponding prepocessor
HAVE_SETPROCTITLE directive.
so until someone figure out how to fix this cmake issue i make this awful hack
in kdelibs/kinit/proctitle.cpp that fix the problem ( only for freebsd
users ;) )
best regards
Manolito
___
Pues todo lo que el hombre sembrare, eso tambien segará
Gál. 6:7
---------------------------------------------------------
For whatever a man sows, that he will also reap.
Gal. 6:7
Index: proctitle.cpp
===================================================================
--- proctitle.cpp (revision 683579)
+++ proctitle.cpp (working copy)
@@ -27,6 +27,8 @@
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
#define PF_ARGV_NONE 0
#define PF_ARGV_NEW 1
@@ -136,7 +138,7 @@
memset(statbuf, 0, sizeof(statbuf));
-#ifdef HAVE_SETPROCTITLE
+// #ifdef HAVE_SETPROCTITLE
# if __FreeBSD__ >= 4 && !defined(FREEBSD4_0) && !defined(FREEBSD4_1)
/* FreeBSD's setproctitle() automatically prepends the process name. */
vsnprintf(statbuf, sizeof(statbuf), fmt, msg);
@@ -152,49 +154,49 @@
# endif /* FREEBSD4 */
setproctitle("%s", statbuf);
-#else /* HAVE_SETPROCTITLE */
- /* Manually append the process name for non-setproctitle() platforms. */
- snprintf(statbuf, sizeof(statbuf), "%s", "kdeinit4: ");
- vsnprintf(statbuf + strlen(statbuf),
- sizeof(statbuf) - strlen(statbuf),
- fmt,
- msg);
+// #else /* HAVE_SETPROCTITLE */
+// /* Manually append the process name for non-setproctitle() platforms. */
+// snprintf(statbuf, sizeof(statbuf), "%s", "kdeinit4: ");
+// vsnprintf(statbuf + strlen(statbuf),
+// sizeof(statbuf) - strlen(statbuf),
+// fmt,
+// msg);
+//
+// #endif /* HAVE_SETPROCTITLE */
-#endif /* HAVE_SETPROCTITLE */
-
va_end(msg);
-#ifdef HAVE_SETPROCTITLE
+// #ifdef HAVE_SETPROCTITLE
return;
-#else
- i = strlen(statbuf);
+// #else
+// i = strlen(statbuf);
-# if PF_ARGV_TYPE == PF_ARGV_NEW
+// # if PF_ARGV_TYPE == PF_ARGV_NEW
/* We can just replace argv[] arguments. Nice and easy. */
- Argv[0] = statbuf;
- Argv[1] = NULL;
-# endif /* PF_ARGV_NEW */
+// Argv[0] = statbuf;
+// Argv[1] = NULL;
+// # endif /* PF_ARGV_NEW */
-# if PF_ARGV_TYPE == PF_ARGV_WRITEABLE
+// # if PF_ARGV_TYPE == PF_ARGV_WRITEABLE
/* We can overwrite individual argv[] arguments. Semi-nice. */
- snprintf(Argv[0], maxlen, "%s", statbuf);
- p = &Argv[0][i];
+// snprintf(Argv[0], maxlen, "%s", statbuf);
+// p = &Argv[0][i];
- while ( p < LastArgv ) {
- *p++ = '\0';
- }
- Argv[1] = NULL;
-# endif /* PF_ARGV_WRITEABLE */
+// while ( p < LastArgv ) {
+// *p++ = '\0';
+// }
+// Argv[1] = NULL;
+// # endif /* PF_ARGV_WRITEABLE */
-# if PF_ARGV_TYPE == PF_ARGV_PSTAT
- pst.pst_command = statbuf;
- pstat(PSTAT_SETCMD, pst, i, 0, 0);
-# endif /* PF_ARGV_PSTAT */
+// # if PF_ARGV_TYPE == PF_ARGV_PSTAT
+// pst.pst_command = statbuf;
+// pstat(PSTAT_SETCMD, pst, i, 0, 0);
+// # endif /* PF_ARGV_PSTAT */
-# if PF_ARGV_TYPE == PF_ARGV_PSSTRINGS
- PS_STRINGS->ps_nargvstr = 1;
- PS_STRINGS->ps_argvstr = statbuf;
-# endif /* PF_ARGV_PSSTRINGS */
+// # if PF_ARGV_TYPE == PF_ARGV_PSSTRINGS
+// PS_STRINGS->ps_nargvstr = 1;
+// PS_STRINGS->ps_argvstr = statbuf;
+// # endif /* PF_ARGV_PSSTRINGS */
-#endif /* HAVE_SETPROCTITLE */
+// #endif /* HAVE_SETPROCTITLE */*/
}
_______________________________________________
kde-freebsd mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-freebsd