mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
initctl: minor, coding style cleanup
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
6a893f50ae
commit
2887795586
1 file changed
+7
-5
+7
-5
@@ -476,15 +476,12 @@ int do_suspend (char *arg) { return do_cmd(INIT_CMD_SUSPEND); }
|
|||||||
|
|
||||||
int utmp_show(char *file)
|
int utmp_show(char *file)
|
||||||
{
|
{
|
||||||
static int once = 0;
|
|
||||||
struct tm *sectm;
|
|
||||||
struct utmp *ut;
|
struct utmp *ut;
|
||||||
time_t sec;
|
time_t sec;
|
||||||
|
|
||||||
int pid;
|
|
||||||
char id[sizeof(ut->ut_id) + 1], user[sizeof(ut->ut_user) + 1], when[80];
|
|
||||||
|
|
||||||
if (heading) {
|
if (heading) {
|
||||||
|
static int once = 0;
|
||||||
|
|
||||||
print_header("%s%s ", once ? "\n" : "", file);
|
print_header("%s%s ", once ? "\n" : "", file);
|
||||||
once++;
|
once++;
|
||||||
}
|
}
|
||||||
@@ -492,7 +489,12 @@ int utmp_show(char *file)
|
|||||||
|
|
||||||
setutent();
|
setutent();
|
||||||
while ((ut = getutent())) {
|
while ((ut = getutent())) {
|
||||||
|
char user[sizeof(ut->ut_user) + 1];
|
||||||
|
char id[sizeof(ut->ut_id) + 1];
|
||||||
|
struct tm *sectm;
|
||||||
|
char when[80];
|
||||||
char addr[64];
|
char addr[64];
|
||||||
|
int pid;
|
||||||
|
|
||||||
strlcpy(id, ut->ut_id, sizeof(id));
|
strlcpy(id, ut->ut_id, sizeof(id));
|
||||||
strlcpy(user, ut->ut_user, sizeof(user));
|
strlcpy(user, ut->ut_user, sizeof(user));
|
||||||
|
|||||||
Reference in new issue
Block a user