aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-09 03:01:12 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-09 03:01:12 +0000
commit482ff7609508db02a8328d915cd8e7e044c1121c (patch)
treef9bfc8bcc664588310f5932329e0bdbb8141d850 /main/asterisk.c
parent150a8ca7e0ac5bba0ce84f558de607940d5a8e28 (diff)
Merged revisions 60849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60849 | tilghman | 2007-04-08 21:49:06 -0500 (Sun, 08 Apr 2007) | 2 lines Don't check for error when lowering priority (according to the manpage, it should never happen anyway). It might could happen, though, if another thread messed with the priority, so safeguard against that (reported via -dev list). ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60850 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 0bb9bdbe0..bba89cc22 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -61,6 +61,8 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#undef sched_setscheduler
+#undef setpriority
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
@@ -1175,10 +1177,8 @@ int ast_set_priority(int pri)
ast_verbose("Set to realtime thread\n");
} else {
sched.sched_priority = 0;
- if (sched_setscheduler(0, SCHED_OTHER, &sched)) {
- ast_log(LOG_WARNING, "Unable to set normal priority\n");
- return -1;
- }
+ /* According to the manpage, these parameters can never fail. */
+ sched_setscheduler(0, SCHED_OTHER, &sched);
}
#else
if (pri) {
@@ -1189,10 +1189,8 @@ int ast_set_priority(int pri)
if (option_verbose)
ast_verbose("Set to high priority\n");
} else {
- if (setpriority(PRIO_PROCESS, 0, 0) == -1) {
- ast_log(LOG_WARNING, "Unable to set normal priority\n");
- return -1;
- }
+ /* According to the manpage, these parameters can never fail. */
+ setpriority(PRIO_PROCESS, 0, 0);
}
#endif
return 0;