mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Correct `LogMaskLocal' when reducing the mask for a
given prompt rather than spamming other prompt masks.
This commit is contained in:
parent
edc521cc08
commit
6756848772
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=35020
@ -23,7 +23,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: log.c,v 1.25.2.1 1998/02/10 03:23:25 brian Exp $
|
||||
* $Id: log.c,v 1.25.2.2 1998/04/03 19:25:40 brian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -83,22 +83,29 @@ log_RegisterPrompt(struct prompt *prompt)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
LogSetMaskLocal(void)
|
||||
{
|
||||
struct prompt *p;
|
||||
|
||||
LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
|
||||
for (p = logprompt; p; p = p->lognext)
|
||||
LogMaskLocal |= p->logmask;
|
||||
}
|
||||
|
||||
void
|
||||
log_UnRegisterPrompt(struct prompt *prompt)
|
||||
{
|
||||
if (prompt) {
|
||||
struct prompt **p;
|
||||
|
||||
LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
|
||||
for (p = &logprompt; *p; p = &(*p)->lognext) {
|
||||
for (p = &logprompt; *p; p = &(*p)->lognext)
|
||||
if (*p == prompt) {
|
||||
*p = (*p)->lognext;
|
||||
*p = prompt->lognext;
|
||||
prompt->lognext = NULL;
|
||||
if (!*p)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
LogMaskLocal |= (*p)->logmask;
|
||||
}
|
||||
LogSetMaskLocal();
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,8 +157,8 @@ void
|
||||
LogDiscardLocal(int id, u_long *mask)
|
||||
{
|
||||
if (id >= LogMIN && id <= LogMAXCONF) {
|
||||
LogMaskLocal &= ~MSK(id);
|
||||
*mask &= ~MSK(id);
|
||||
LogSetMaskLocal();
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +171,8 @@ LogDiscardAll()
|
||||
void
|
||||
LogDiscardAllLocal(u_long *mask)
|
||||
{
|
||||
LogMaskLocal = *mask = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
|
||||
*mask = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
|
||||
LogSetMaskLocal();
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user