After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 140061 - build problem on HPUX 11.00
build problem on HPUX 11.00
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: general
unspecified
Other HP-UX
: Urgent normal
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2004-04-14 15:56 UTC by martin01
Modified: 2011-11-11 10:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description martin01 2004-04-14 15:56:01 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 ?
Comment 1 Benoît Dejean 2005-01-16 12:16:28 UTC
libgnomesu is now used for prompting password. This code is dead.