#define DEFAULT_SAMPLE_RATE 8000
#define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000)
+#define setpriority __PLEASE_USE_ast_set_priority_INSTEAD_OF_setpriority__
+#define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__
/* provided in asterisk.c */
extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#undef sched_setscheduler
+#undef setpriority
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
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) {
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;