subr_log.c (116182) | subr_log.c (116634) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33 * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 34 */ 35 36/* 37 * Error log buffer for kernel printf's. 38 */ 39 40#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 24 unchanged lines hidden (view full) --- 33 * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 34 */ 35 36/* 37 * Error log buffer for kernel printf's. 38 */ 39 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/kern/subr_log.c 116182 2003-06-11 00:56:59Z obrien $"); | 41__FBSDID("$FreeBSD: head/sys/kern/subr_log.c 116634 2003-06-20 22:18:38Z bmilekic $"); |
42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/conf.h> 46#include <sys/proc.h> 47#include <sys/vnode.h> 48#include <sys/filio.h> 49#include <sys/ttycom.h> --- 46 unchanged lines hidden (view full) --- 96static int 97logopen(dev_t dev, int flags, int mode, struct thread *td) 98{ 99 if (log_open) 100 return (EBUSY); 101 log_open = 1; 102 callout_init(&logsoftc.sc_callout, 0); 103 fsetown(td->td_proc->p_pid, &logsoftc.sc_sigio); /* signal process only */ | 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/conf.h> 46#include <sys/proc.h> 47#include <sys/vnode.h> 48#include <sys/filio.h> 49#include <sys/ttycom.h> --- 46 unchanged lines hidden (view full) --- 96static int 97logopen(dev_t dev, int flags, int mode, struct thread *td) 98{ 99 if (log_open) 100 return (EBUSY); 101 log_open = 1; 102 callout_init(&logsoftc.sc_callout, 0); 103 fsetown(td->td_proc->p_pid, &logsoftc.sc_sigio); /* signal process only */ |
104 if (log_wakeups_per_second < 1) { 105 printf("syslog wakeup is less than one. Adjusting to 1.\n"); 106 log_wakeups_per_second = 1; 107 } |
|
104 callout_reset(&logsoftc.sc_callout, hz / log_wakeups_per_second, 105 logtimeout, NULL); 106 return (0); 107} 108 109/*ARGSUSED*/ 110static int 111logclose(dev_t dev, int flag, int mode, struct thread *td) --- 66 unchanged lines hidden (view full) --- 178} 179 180static void 181logtimeout(void *arg) 182{ 183 184 if (!log_open) 185 return; | 108 callout_reset(&logsoftc.sc_callout, hz / log_wakeups_per_second, 109 logtimeout, NULL); 110 return (0); 111} 112 113/*ARGSUSED*/ 114static int 115logclose(dev_t dev, int flag, int mode, struct thread *td) --- 66 unchanged lines hidden (view full) --- 182} 183 184static void 185logtimeout(void *arg) 186{ 187 188 if (!log_open) 189 return; |
190 if (log_wakeups_per_second < 1) { 191 printf("syslog wakeup is less than one. Adjusting to 1.\n"); 192 log_wakeups_per_second = 1; 193 } |
|
186 if (msgbuftrigger == 0) { 187 callout_reset(&logsoftc.sc_callout, 188 hz / log_wakeups_per_second, logtimeout, NULL); 189 return; 190 } 191 msgbuftrigger = 0; 192 selwakeup(&logsoftc.sc_selp); 193 if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) --- 67 unchanged lines hidden --- | 194 if (msgbuftrigger == 0) { 195 callout_reset(&logsoftc.sc_callout, 196 hz / log_wakeups_per_second, logtimeout, NULL); 197 return; 198 } 199 msgbuftrigger = 0; 200 selwakeup(&logsoftc.sc_selp); 201 if ((logsoftc.sc_state & LOG_ASYNC) && logsoftc.sc_sigio != NULL) --- 67 unchanged lines hidden --- |