Follow-up to 9856e07, rename '-K' option to '-t'

We need the '-K' option to disable kernel logging, so this option needs
to be renamed, unfortunately.  Fortunately it's not been released yet.

Issue #42

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-02-13 22:51:55 +01:00
parent f38fd01871
commit e61e5abb88
2 changed files with 32 additions and 25 deletions

View File

@@ -286,7 +286,6 @@ int usage(int code)
" -F Run in foreground, required when monitored by init(1)\n"
" -f FILE Alternate .conf file, default: %s\n"
" -k Allow logging with facility 'kernel', otherwise remapped to 'user'\n"
" -K Keep kernel timestamp, even after initial ring buffer emptying\n"
" -m MINS Interval between MARK messages, 0 to disable, default: 20 min\n"
" -n Disable DNS query for every request\n"
" -P FILE File to store the process ID, default: %s\n"
@@ -298,6 +297,7 @@ int usage(int code)
" -s Operate in secure mode, do not log messages from remote machines.\n"
" If specified twice, no socket at all will be opened, which also\n"
" disables support for logging to remote machines.\n"
" -t Keep kernel timestamp, even after initial ring buffer emptying\n"
" -T Use local time and date for messages received from remote hosts\n"
" -? Show this help text\n"
" -v Show program version and exit\n"
@@ -318,7 +318,7 @@ int main(int argc, char *argv[])
int pflag = 0, bflag = 0;
int ch;
while ((ch = getopt(argc, argv, "46Aa:b:C:dHFf:Kkm:nP:p:r:sTv?")) != EOF) {
while ((ch = getopt(argc, argv, "46Aa:b:C:dHFf:km:nP:p:r:sTtv?")) != EOF) {
switch ((char)ch) {
case '4':
family = PF_INET;
@@ -373,10 +373,6 @@ int main(int argc, char *argv[])
KeepKernFac = 1;
break;
case 'K': /* keep/trust kernel timestamp always */
KeepKernTime = 1;
break;
case 'm': /* mark interval */
MarkInterval = atoi(optarg) * 60;
break;
@@ -414,6 +410,10 @@ int main(int argc, char *argv[])
RemoteAddDate = 1;
break;
case 't': /* keep/trust kernel timestamp always */
KeepKernTime = 1;
break;
case 'v':
printf("syslogd v%s\n", VERSION);
exit(0);
@@ -584,8 +584,15 @@ static void kernel_cb(int fd, void *arg)
static int opensys(const char *file)
{
// struct stat st;
int fd;
// sleep(300);
// return 1;
// if (stat(file, &st) || !S_ISCHR(st.st_mode))
// return 1;
fd = open(file, O_RDONLY | O_NONBLOCK | O_CLOEXEC, 0);
if (fd < 0)
return 1;