GNOME Bugzilla – Bug 140061
build problem on HPUX 11.00
Last modified: 2011-11-11 10:03:55 UTC
on hpux the compilation fails with the following error message: /usr/ccs/bin/ld: Unsatisfied symbols: getpt (first referenced in util.o) (code) asprintf (first referenced in util.o) (code) it tried to add the failing functions(), to gnome-system-monitor- 2.4.0/src/util.c #if defined(__hpux) /* HPUX doesn't have getpt(). This function emulates it's behaviour. */ int getpt (void); int getpt () { int master, slave; if (open (&master, &slave, NULL, NULL, NULL) < 0) { /* Simulate getpt()'s only error condition. */ errno = ENOENT; return -1; } return master; } #endif /* We have replacement versions of these if they're missing. */ #ifndef HAVE_ASPRINTF #include <assert.h> #define portable_vsnprintf vsnprintf int asprintf(char **ptr, const char *fmt, /*args*/ ...) { va_list ap; size_t str_m; int str_l; *ptr = NULL; va_start(ap, fmt); /* measure the required size */ str_l = portable_vsnprintf(NULL, (size_t)0, fmt, ap); va_end(ap); assert(str_l >= 0); /* possible integer overflow if str_m > INT_MAX */ *ptr = (char *) malloc(str_m = (size_t)str_l + 1); if (*ptr == NULL) { errno = ENOMEM; str_l = -1; } else { int str_l2; va_start(ap, fmt); str_l2 = portable_vsnprintf(*ptr, str_m, fmt, ap); va_end(ap); assert(str_l2 == str_l); } return str_l; } #endif finaly system-monitor compiles, but with warnings: util.c: In function `getpt': util.c:72: warning: passing arg 1 of `open' from incompatible pointer type util.c:72: warning: passing arg 2 of `open' makes integer from pointer without a cast could someone check this hack ?
libgnomesu is now used for prompting password. This code is dead.