--- projects/libstatgrab/src/libstatgrab/process_stats.c 2004/04/08 17:20:51 1.71 +++ projects/libstatgrab/src/libstatgrab/process_stats.c 2004/04/08 23:30:29 1.72 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA * - * $Id: process_stats.c,v 1.71 2004/04/08 17:20:51 tdb Exp $ + * $Id: process_stats.c,v 1.72 2004/04/08 23:30:29 ats Exp $ */ #ifdef HAVE_CONFIG_H @@ -412,6 +412,15 @@ sg_process_stats *sg_get_process_stats(int *entries){ return NULL; } p = proctitle; +#ifdef OPENBSD + /* On OpenBSD, this value has the argv pointers (which + * are terminated by a NULL) at the front, so we have + * to skip over them to get to the strings. */ + while (*(char ***)p != NULL) { + p += sizeof(char **); + } + p += sizeof(char **); +#endif proc_state_ptr->proctitle[0] = '\0'; do { sg_strlcat(proc_state_ptr->proctitle, p, size+1);