diff options
Diffstat (limited to 'openbsd-compat/port-irix.c')
-rw-r--r-- | openbsd-compat/port-irix.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/openbsd-compat/port-irix.c b/openbsd-compat/port-irix.c index a63ec429a..bd03366f5 100644 --- a/openbsd-compat/port-irix.c +++ b/openbsd-compat/port-irix.c | |||
@@ -3,13 +3,20 @@ | |||
3 | #if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) | 3 | #if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) |
4 | 4 | ||
5 | #ifdef WITH_IRIX_PROJECT | 5 | #ifdef WITH_IRIX_PROJECT |
6 | #include <proj.h> | 6 | # include <proj.h> |
7 | #endif /* WITH_IRIX_PROJECT */ | 7 | #endif /* WITH_IRIX_PROJECT */ |
8 | #ifdef WITH_IRIX_JOBS | 8 | #ifdef WITH_IRIX_JOBS |
9 | #include <sys/resource.h> | 9 | # include <sys/resource.h> |
10 | #endif | 10 | # include <optional_sym.h> |
11 | # if !defined(JLIMIT_CPU) | ||
12 | /* Simulate job limit support so we can still test for it at runtime. */ | ||
13 | typedef __int64_t jid_t; | ||
14 | extern jid_t jlimit_startjob(char *, uid_t, char *); | ||
15 | # pragma optional jlimit_startjob | ||
16 | # endif | ||
17 | #endif /* WITH_IRIX_JOBS */ | ||
11 | #ifdef WITH_IRIX_AUDIT | 18 | #ifdef WITH_IRIX_AUDIT |
12 | #include <sat.h> | 19 | # include <sat.h> |
13 | #endif /* WITH_IRIX_AUDIT */ | 20 | #endif /* WITH_IRIX_AUDIT */ |
14 | 21 | ||
15 | void | 22 | void |
@@ -27,10 +34,16 @@ irix_setusercontext(struct passwd *pw) | |||
27 | #endif /* WITH_IRIX_JOBS */ | 34 | #endif /* WITH_IRIX_JOBS */ |
28 | 35 | ||
29 | #ifdef WITH_IRIX_JOBS | 36 | #ifdef WITH_IRIX_JOBS |
30 | jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); | 37 | if (_MIPS_SYMBOL_PRESENT(jlimit_startjob)) { |
31 | if (jid == -1) | 38 | jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); |
32 | fatal("Failed to create job container: %.100s", | 39 | if (jid == -1) { |
40 | if (errno == ENOPKG) | ||
41 | jid = 0; | ||
42 | else | ||
43 | fatal("Failed to create job container: %.100s", | ||
33 | strerror(errno)); | 44 | strerror(errno)); |
45 | } | ||
46 | } | ||
34 | #endif /* WITH_IRIX_JOBS */ | 47 | #endif /* WITH_IRIX_JOBS */ |
35 | #ifdef WITH_IRIX_ARRAY | 48 | #ifdef WITH_IRIX_ARRAY |
36 | /* initialize array session */ | 49 | /* initialize array session */ |