[Asterisk-code-review] asterisk.c: Non-root users also get the astcanary after core... (asterisk[master])

Corey Farrell asteriskteam at digium.com
Mon Sep 19 11:01:08 CDT 2016


Corey Farrell has posted comments on this change.

Change subject: asterisk.c: Non-root users also get the astcanary after core restart.
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/3920/2/main/asterisk.c
File main/asterisk.c:

PS2, Line 1786: #ifdef __linux__
              : 	return sched_getscheduler(0);
              : #else
              : 	return getpriority(PRIO_PROCESS, 0);
              : #endif
Still an issue here.  Maybe fix with:
return getpriority(PRIO_PROCESS, 0) * -1;

sched_getscheduler will return 0 for normal priority, greater than 0 for realtime.

getpriority will return 0 for normal priority, less than 0 for high/realtime priority, greater than 0 for low priority.


Line 4320: 	if (get_priority()) {
Assuming you follow my suggestion for the return for getpriority this actually needs to check get_priority() > 0.  get_priority can return negative values to indicate lower than normal priority for non-linux.


-- 
To view, visit https://gerrit.asterisk.org/3920
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iacb49f26491a0717084ad46ed96b0bea5f627a55
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Walter Doekes <walter+asterisk at wjd.nu>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list