This makes the code more thread-safe, and squelches a warning.
static int get_dlpi_ppa(int, const char *, int, char *);
#endif
static int get_dlpi_ppa(int, const char *, int, char *);
#endif
-/* XXX Needed by HP-UX (at least) */
-static bpf_u_int32 ctlbuf[MAXDLBUF];
-static struct strbuf ctl = {
- MAXDLBUF,
- 0,
- (char *)ctlbuf
-};
-
/*
* Cast a buffer to "union DL_primitives" without provoking warnings
* from the compiler.
/*
* Cast a buffer to "union DL_primitives" without provoking warnings
* from the compiler.
int cc;
u_char *bp;
int flags;
int cc;
u_char *bp;
int flags;
+ bpf_u_int32 ctlbuf[MAXDLBUF];
+ struct strbuf ctl = {
+ MAXDLBUF,
+ 0,
+ (char *)ctlbuf
+ };
struct strbuf data;
flags = 0;
struct strbuf data;
flags = 0;
* would be DL_HP_RAWDATA_IND on HP-UX
* if we're in raw mode?
*/
* would be DL_HP_RAWDATA_IND on HP-UX
* if we're in raw mode?
*/
+ ctl.buf = (char *)ctlbuf;
+ ctl.maxlen = MAXDLBUF;
+ ctl.len = 0;
if (getmsg(p->fd, &ctl, &data, &flags) < 0) {
/* Don't choke when we get ptraced */
switch (errno) {
if (getmsg(p->fd, &ctl, &data, &flags) < 0) {
/* Don't choke when we get ptraced */
switch (errno) {