Skip to content

Commit

Permalink
rename tell_verbose_status() into tell_status that takes an additiona…
Browse files Browse the repository at this point in the history
…l parameter to distinguish between status and status all that has more detail and use it to tell maximum number of open files (sockets) only if detail requested
  • Loading branch information
Michael Ortmann committed Oct 2, 2023
1 parent 49a1d5c commit 8ec4cf7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/chanprog.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void tell_verbose_uptime(int idx)

/* Dump status info out to dcc
*/
void tell_verbose_status(int idx)
void tell_status(int idx, int details)
{
char s[256], s1[121], s2[81], *sysrel;
int i;
Expand Down Expand Up @@ -368,7 +368,7 @@ void tell_verbose_status(int idx)
#endif
"Socket table: %d/%d\n", threaddata()->MAXSOCKS, max_socks);

if (!getrlimit(RLIMIT_NOFILE, &rlp))
if (details && !getrlimit(RLIMIT_NOFILE, &rlp))
dprintf(idx, "Maximum number of open files (sockets): soft limit %ju hard limit %ju\n",
(uintmax_t) rlp.rlim_cur, (uintmax_t) rlp.rlim_max);
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,14 @@ static void cmd_status(struct userrec *u, int idx, char *par)
return;
}
putlog(LOG_CMDS, "*", "#%s# status all", dcc[idx].nick);
tell_verbose_status(idx);
tell_status(idx, 1);
tell_mem_status_dcc(idx);
dprintf(idx, "\n");
tell_settings(idx);
do_module_report(idx, 1, NULL);
} else {
putlog(LOG_CMDS, "*", "#%s# status", dcc[idx].nick);
tell_verbose_status(idx);
tell_status(idx, 0);
tell_mem_status_dcc(idx);
do_module_report(idx, 0, NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ static void core_secondly()
printf("NOTE: You don't need to use the -n flag with the\n");
printf(" -t or -c flag anymore.\n");
}
tell_verbose_status(DP_STDOUT);
tell_status(DP_STDOUT, 1);
do_module_report(DP_STDOUT, 0, "server");
do_module_report(DP_STDOUT, 0, "channels");
tell_mem_status_dcc(DP_STDOUT);
Expand Down
2 changes: 1 addition & 1 deletion src/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ char *int_to_base64(unsigned int);

/* chanprog.c */
void tell_verbose_uptime(int);
void tell_verbose_status(int);
void tell_status(int, int);
void tell_settings(int);
int logmodes(char *);
int isowner(char *);
Expand Down

0 comments on commit 8ec4cf7

Please sign in to comment.