Change ut_list_p variable from global to local
The variable ut_list_p, is used in two seperate functions, read_wtmp() and free_wtmp(), it's state isn't preserved, nor is it important, therefore it's cleaner to simply use two local variables in each function, rather than one global variable, used across both.
This commit is contained in:
parent
37f91bf330
commit
e4c67052ef
|
@ -165,7 +165,6 @@ struct ut_list {
|
|||
};
|
||||
|
||||
struct ut_list *wtmplist = (struct ut_list *) NULL;
|
||||
struct ut_list *ut_list_p;
|
||||
|
||||
struct time_ent {
|
||||
int days;
|
||||
|
@ -388,6 +387,7 @@ void read_wtmp()
|
|||
{
|
||||
FILE *fp;
|
||||
struct utmp ut;
|
||||
struct ut_list *ut_list_p;
|
||||
struct tm *tm;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -445,6 +445,7 @@ void read_wtmp()
|
|||
|
||||
void free_wtmp()
|
||||
{
|
||||
struct ut_list *ut_list_p;
|
||||
#ifdef DEBUG
|
||||
openlog("timeoutd", OPENLOG_FLAGS, LOG_DAEMON);
|
||||
syslog(SYSLOG_DEBUG, "Freeing list of today's wtmp entries.");
|
||||
|
|
Loading…
Reference in a new issue