From 897c91fa75d73bc6399e185af93e269e6a4af40d Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Thu, 30 Jun 2022 13:51:22 +0530 Subject: [PATCH] daemon/cgruleseng.h: increase the column width to 100 100 column width is more comfortable to read over 80 columns, lets increase it. This patch, also introduced/removes empty lines across the file, making it more readable. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- src/daemon/cgrulesengd.h | 43 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/daemon/cgrulesengd.h b/src/daemon/cgrulesengd.h index 8ab64d8d..70ad3981 100644 --- a/src/daemon/cgrulesengd.h +++ b/src/daemon/cgrulesengd.h @@ -29,10 +29,8 @@ extern "C" { #endif /* The following ten macros are all for the Netlink code. */ -#define SEND_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \ - sizeof(enum proc_cn_mcast_op))) -#define RECV_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \ - sizeof(struct proc_event))) +#define SEND_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + sizeof(enum proc_cn_mcast_op))) +#define RECV_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + sizeof(struct proc_event))) #define SEND_MESSAGE_SIZE (NLMSG_SPACE(SEND_MESSAGE_LEN)) #define RECV_MESSAGE_SIZE (NLMSG_SPACE(RECV_MESSAGE_LEN)) @@ -44,8 +42,8 @@ extern "C" { #define PROC_CN_MCAST_IGNORE (2) /** - * Prints the usage information for this program and, optionally, an error - * message. This function uses vfprintf. + * Prints the usage information for this program and, optionally, + * an error message. This function uses vfprintf. * @param fd The file stream to print to * @param msg The error message to print (printf style) * @param ... Any args to msg (printf style) @@ -63,9 +61,9 @@ void cgre_usage(FILE *fd, const char *msg, ...); void flog(int level, const char *msg, ...); /** - * Process an event from the kernel, and determine the correct UID/GID/PID to - * pass to libcgroup. Then, libcgroup will decide the cgroup to move the PID - * to, if any. + * Process an event from the kernel, and determine the correct UID/GID/PID + * to pass to libcgroup. Then, libcgroup will decide the cgroup to move + * the PID to, if any. * @param ev The event to process * @param type The type of event to process (part of ev) * @return 0 on success, > 0 on failure @@ -73,9 +71,10 @@ void flog(int level, const char *msg, ...); int cgre_process_event(const struct proc_event *ev, const int type); /** - * Handle a netlink message. In the event of PROC_EVENT_UID or PROC_EVENT_GID, - * we pass the event along to cgre_process_event for further processing. All - * other events are ignored. + * Handle a netlink message. + * In the event of PROC_EVENT_UID or PROC_EVENT_GID, we pass the event + * along to cgre_process_event for further processing. All other events + * are ignored. * @param cn_hdr The netlink message * @return 0 on success, > 0 on error */ @@ -88,29 +87,30 @@ int cgre_handle_message(struct cn_msg *cn_hdr); * @param logp Path of the log file, NULL if no log file was specified * @param logf Syslog facility, NULL if no facility was specified * @param daemon False to turn off daemon mode (no fork, leave FDs open) - * @param logv Log verbosity, 2 is the default, 0 = no logging, 5 = everything + * @param logv Log verbosity: + * 2 is the default, 0 = no logging, 5 = everything * @return 0 on success, > 0 on error */ -int cgre_start_daemon(const char *logp, const int logf, - const unsigned char daemon, const int logv); +int cgre_start_daemon(const char *logp, const int logf, const unsigned char daemon, + const int logv); /** - * Catch the SIGUSR2 signal and reload the rules configuration. This function - * makes use of the logfile and flog() to print the new rules. + * Catch the SIGUSR2 signal and reload the rules configuration. + * This function makes use of the logfile and flog() to print the new rules. * @param signum The signal that we caught (always SIGUSR2) */ void cgre_flash_rules(int signum); /** - * Catch the SIGUSR1 signal and reload the rules configuration. This function - * makes use of the logfile and flog() to print the new rules. + * Catch the SIGUSR1 signal and reload the rules configuration. + * This function makes use of the logfile and flog() to print the new rules. * @param signum The signal that we caught (always SIGUSR1) */ void cgre_flash_templates(int signum); /** - * Catch the SIGTERM and SIGINT signal so that we can exit gracefully. Before - * exiting, this function makes use of the logfile and flog(). + * Catch the SIGTERM and SIGINT signal so that we can exit gracefully. + * Before exiting, this function makes use of the logfile and flog(). * @param signum The signal that we caught (SIGTERM, SIGINT) */ void cgre_catch_term(int signum); @@ -120,4 +120,3 @@ void cgre_catch_term(int signum); #endif #endif /* _CGRULESENGD_H */ - -- 2.47.2