Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107261959
D41357.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41357.diff
View Options
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -247,6 +247,17 @@
size_t pflt_strlen;
};
+enum f_type {
+ F_UNUSED, /* unused entry */
+ F_FILE, /* regular file */
+ F_TTY, /* terminal */
+ F_CONSOLE, /* console terminal */
+ F_FORW, /* remote machine */
+ F_USERS, /* list of users */
+ F_WALL, /* everyone logged on */
+ F_PIPE, /* pipe to program */
+};
+
/*
* This structure represents the files that will have log
* copies printed.
@@ -256,8 +267,8 @@
struct filed {
STAILQ_ENTRY(filed) next; /* next in linked list */
- short f_type; /* entry type, see below */
- short f_file; /* file descriptor */
+ enum f_type f_type;
+ int f_file; /* file descriptor */
time_t f_time; /* time this was last written */
char *f_host; /* host from which to recd. */
u_char f_pmask[LOG_NFACILITIES+1]; /* priority mask */
@@ -351,16 +362,6 @@
(f)->f_repeatcount = MAXREPEAT; \
} while (0)
-/* values for f_type */
-#define F_UNUSED 0 /* unused entry */
-#define F_FILE 1 /* regular file */
-#define F_TTY 2 /* terminal */
-#define F_CONSOLE 3 /* console terminal */
-#define F_FORW 4 /* remote machine */
-#define F_USERS 5 /* list of users */
-#define F_WALL 6 /* everyone logged on */
-#define F_PIPE 7 /* pipe to program */
-
static const char *TypeNames[] = {
"UNUSED", "FILE", "TTY", "CONSOLE",
"FORW", "USERS", "WALL", "PIPE"
@@ -472,7 +473,6 @@
f->fu_forw_addr = NULL;
}
/* FALLTHROUGH */
-
case F_FILE:
case F_TTY:
case F_CONSOLE:
@@ -481,6 +481,8 @@
case F_PIPE:
f->fu_pipe_pid = 0;
break;
+ default:
+ break;
}
(void)close(f->f_file);
f->f_file = -1;
@@ -1978,6 +1980,8 @@
iovlist_append(il, "\r\n");
wallmsg(f, il->iov, il->iovcnt);
break;
+ default:
+ break;
}
}
@@ -2616,6 +2620,8 @@
deadq_enter(f->fu_pipe_pid, f->fu_pipe_pname);
close_filed(f);
break;
+ default:
+ break;
}
}
while(!STAILQ_EMPTY(&fhead)) {
@@ -2713,6 +2719,8 @@
for (i = 0; i < MAXUNAMES && *f->fu_uname[i]; i++)
printf("%s, ", f->fu_uname[i]);
break;
+ default:
+ break;
}
if (f->f_program)
printf(" (%s)", f->f_program);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 7:51 PM (20 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15772436
Default Alt Text
D41357.diff (2 KB)
Attached To
Mode
D41357: syslogd: Fix fd type, add enum for filed types
Attached
Detach File
Event Timeline
Log In to Comment