Don't try to use acct() on cygwin (which doesn't support it). Fixes: #111
This commit is contained in:
parent
8d321900b4
commit
5f83fd85dc
|
@ -47,6 +47,14 @@ struct timeb { /* non-existing; we use an ad-hoc definition */
|
||||||
#include "warn.h"
|
#include "warn.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
|
||||||
|
/* Detect supported system calls. */
|
||||||
|
|
||||||
|
#if !defined __CYGWIN__
|
||||||
|
#define HAS_ACCT 1
|
||||||
|
#else
|
||||||
|
#define HAS_ACCT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define INPUT 0
|
#define INPUT 0
|
||||||
#define OUTPUT 1
|
#define OUTPUT 1
|
||||||
|
|
||||||
|
@ -914,15 +922,22 @@ moncall()
|
||||||
case 51: /* Acct */
|
case 51: /* Acct */
|
||||||
|
|
||||||
dsp1 = pop_ptr();
|
dsp1 = pop_ptr();
|
||||||
if (!savestr(0, dsp1) || acct(buf[0]) == -1) {
|
#if HAS_ACCT
|
||||||
|
if (!savestr(0, dsp1) || acct(buf[0]) == -1) {
|
||||||
|
push_err();
|
||||||
|
LOG(("@m4 Acct: failed, dsp1 = %lu, errno = %d",
|
||||||
|
dsp1, errno));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
push_int(0);
|
||||||
|
LOG(("@m9 Acct: succeeded, dsp1 = %lu", dsp1));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
einval(WMPXIMP);
|
||||||
push_err();
|
push_err();
|
||||||
LOG(("@m4 Acct: failed, dsp1 = %lu, errno = %d",
|
LOG(("@m4 Acct: failed, request = %d, dsp1 = %lu, errno = %d",
|
||||||
dsp1, errno));
|
request, dsp1, errno));
|
||||||
}
|
#endif
|
||||||
else {
|
|
||||||
push_int(0);
|
|
||||||
LOG(("@m9 Acct: succeeded, dsp1 = %lu", dsp1));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 54: /* Ioctl */
|
case 54: /* Ioctl */
|
||||||
|
|
Loading…
Reference in a new issue