From 6aab712cb4220c5a8471ba581c06676af19fae07 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 14 Jan 2008 05:05:22 +0000 Subject: strip trailing newlines --- src/rc/_usage.c | 2 +- src/rc/_usage.h | 2 +- src/rc/builtins.h | 2 +- src/rc/checkpath.c | 6 +++--- src/rc/fstabinfo.c | 4 ++-- src/rc/mountinfo.c | 8 ++++---- src/rc/rc-depend.c | 4 ++-- src/rc/rc-logger.c | 4 ++-- src/rc/rc-logger.h | 2 +- src/rc/rc-misc.c | 2 +- src/rc/rc-plugin.c | 4 ++-- src/rc/rc-plugin.h | 4 ++-- src/rc/rc-status.c | 2 +- src/rc/rc-update.c | 6 +++--- src/rc/rc.c | 14 +++++++------- src/rc/runscript.c | 16 ++++++++-------- src/rc/start-stop-daemon.c | 6 +++--- 17 files changed, 44 insertions(+), 44 deletions(-) (limited to 'src/rc') diff --git a/src/rc/_usage.c b/src/rc/_usage.c index 32b4bbc1..b6e2bebb 100644 --- a/src/rc/_usage.c +++ b/src/rc/_usage.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/_usage.h b/src/rc/_usage.h index e4a5fa3b..ea2d52ab 100644 --- a/src/rc/_usage.h +++ b/src/rc/_usage.h @@ -1,4 +1,4 @@ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/builtins.h b/src/rc/builtins.h index 43a4d9f9..7d05fa76 100644 --- a/src/rc/builtins.h +++ b/src/rc/builtins.h @@ -1,4 +1,4 @@ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c index db81a631..ffefc884 100644 --- a/src/rc/checkpath.c +++ b/src/rc/checkpath.c @@ -4,7 +4,7 @@ if necessary. It can also correct its ownership. */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -62,7 +62,7 @@ static int do_check (char *path, uid_t uid, gid_t gid, mode_t mode, int file) eerror ("%s: open: %s", applet, strerror (errno)); return (-1); } - close (fd); + close (fd); } else { einfo ("%s: creating directory", path); if (! mode) @@ -139,7 +139,7 @@ static int parse_owner (struct passwd **user, struct group **group, if (user && *u) { if (sscanf (u, "%d", &id) == 1) *user = getpwuid (id); - else + else *user = getpwnam (u); if (! *user) retval = -1; diff --git a/src/rc/fstabinfo.c b/src/rc/fstabinfo.c index e67d8313..6dba903b 100644 --- a/src/rc/fstabinfo.c +++ b/src/rc/fstabinfo.c @@ -3,7 +3,7 @@ Gets information about /etc/fstab. */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -128,7 +128,7 @@ int fstabinfo (int argc, char **argv) char *file; bool filtered = false; - applet = basename_c (argv[0]); + applet = basename_c (argv[0]); /* Ensure that we are only quiet when explicitly told to be */ unsetenv ("EINFO_QUIET"); diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c index 989dcbdc..8a847b8f 100644 --- a/src/rc/mountinfo.c +++ b/src/rc/mountinfo.c @@ -3,7 +3,7 @@ Obtains information about mounted filesystems. */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -35,7 +35,7 @@ #if defined(__DragonFly__) || defined(__FreeBSD__) # include # include -# define F_FLAGS f_flags +# define F_FLAGS f_flags #elif defined(BSD) # include # define statfs statvfs @@ -169,7 +169,7 @@ static int process_mount (char ***list, struct args *args, return (-1); } -#ifdef BSD +#ifdef BSD /* Translate the mounted options to english * This is taken directly from FreeBSD mount.c */ @@ -195,7 +195,7 @@ static struct opt { #endif #ifdef MNT_NOCLUSTERW { MNT_NOCLUSTERW, "noclusterw" }, -#endif +#endif #ifdef MNT_SUIDDIR { MNT_SUIDDIR, "suiddir" }, #endif diff --git a/src/rc/rc-depend.c b/src/rc/rc-depend.c index 4a5d64e1..be998c40 100644 --- a/src/rc/rc-depend.c +++ b/src/rc/rc-depend.c @@ -3,7 +3,7 @@ rc service dependency and ordering */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -96,7 +96,7 @@ int rc_depend (int argc, char **argv) int opt; char *token; - applet = basename_c (argv[0]); + applet = basename_c (argv[0]); while ((opt = getopt_long (argc, argv, getoptstring, longopts, (int *) 0)) != -1) diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index 0d9c514c..46093433 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -4,7 +4,7 @@ them to a buffer and/or files. */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -227,7 +227,7 @@ void rc_logger_open (const char *level) } } free (buffer); - if (logbuf) { + if (logbuf) { if ((log = fopen (LOGFILE, "a"))) { write_time (log, "started"); write_log (fileno (log), logbuf, logbuf_len); diff --git a/src/rc/rc-logger.h b/src/rc/rc-logger.h index c15e73f8..2ac8ddc6 100644 --- a/src/rc/rc-logger.h +++ b/src/rc/rc-logger.h @@ -1,4 +1,4 @@ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c index fe6022e2..d85126da 100644 --- a/src/rc/rc-misc.c +++ b/src/rc/rc-misc.c @@ -3,7 +3,7 @@ rc misc functions */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/rc-plugin.c b/src/rc/rc-plugin.c index f50b4343..635e52fb 100644 --- a/src/rc/rc-plugin.c +++ b/src/rc/rc-plugin.c @@ -1,9 +1,9 @@ /* - librc-plugin.c + librc-plugin.c Simple plugin handler */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/rc-plugin.h b/src/rc/rc-plugin.h index 412a47e7..77873717 100644 --- a/src/rc/rc-plugin.h +++ b/src/rc/rc-plugin.h @@ -1,9 +1,9 @@ /* - librc-plugin.h + librc-plugin.h Private instructions to use plugins */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index f57584ab..445e6e72 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -3,7 +3,7 @@ Display the status of the services in runlevels */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved diff --git a/src/rc/rc-update.c b/src/rc/rc-update.c index 463c0cfe..7181ac1a 100644 --- a/src/rc/rc-update.c +++ b/src/rc/rc-update.c @@ -3,7 +3,7 @@ Manage init scripts and runlevels */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -84,7 +84,7 @@ static int delete (const char *runlevel, const char *service) if (errno == ENOENT) eerror ("%s: service `%s' is not in the runlevel `%s'", applet, service, runlevel); - else + else eerror ("%s: failed to remove service `%s' from runlevel `%s': %s", applet, service, runlevel, strerror (errno)); @@ -159,7 +159,7 @@ int rc_update (int argc, char **argv) int opt; int retval = EXIT_FAILURE; - applet = basename_c (argv[0]); + applet = basename_c (argv[0]); while ((opt = getopt_long (argc, argv, getoptstring, longopts, (int *) 0)) != -1) diff --git a/src/rc/rc.c b/src/rc/rc.c index 6fcbd981..567da725 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -8,7 +8,7 @@ einfo family of informational functions. */ -/* +/* * Copyright 2007-2008 Roy Marples * All rights reserved @@ -252,7 +252,7 @@ static int do_e (int argc, char **argv) message = xmalloc (l); p = message; - for (i = 0; i < argc; i++) { + for (i = 0; i < argc; i++) { if (i > 0) *p++ = ' '; memcpy (p, argv[i], strlen (argv[i])); @@ -264,11 +264,11 @@ static int do_e (int argc, char **argv) if (! message) message = xstrdup (""); - if (strcmp (applet, "einfo") == 0) + if (strcmp (applet, "einfo") == 0) einfo ("%s", message); else if (strcmp (applet, "einfon") == 0) einfon ("%s", message); - else if (strcmp (applet, "ewarn") == 0) + else if (strcmp (applet, "ewarn") == 0) ewarn ("%s", message); else if (strcmp (applet, "ewarnn") == 0) ewarnn ("%s", message); @@ -286,11 +286,11 @@ static int do_e (int argc, char **argv) ewend (retval, "%s", message); else if (strcmp (applet, "esyslog") == 0) elog (level, "%s", message); - else if (strcmp (applet, "veinfo") == 0) + else if (strcmp (applet, "veinfo") == 0) einfov ("%s", message); else if (strcmp (applet, "veinfon") == 0) einfovn ("%s", message); - else if (strcmp (applet, "vewarn") == 0) + else if (strcmp (applet, "vewarn") == 0) ewarnv ("%s", message); else if (strcmp (applet, "vewarnn") == 0) ewarnvn ("%s", message); @@ -494,7 +494,7 @@ static char *proc_getent (const char *ent) if ((proc = rc_getline (fp)) && (p = strstr (proc, ent))) - { + { i = p - proc; if (i == '\0' || proc[i - 1] == ' ') { p += strlen (ent); diff --git a/src/rc/runscript.c b/src/rc/runscript.c index e136e944..a80e25f6 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -3,7 +3,7 @@ * Handle launching of init scripts. */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -181,7 +181,7 @@ static void handle_signal (int sig) if (! signame[0]) snprintf (signame, sizeof (signame), "SIGQUIT"); /* Send the signal to our children too */ - if (service_pid > 0) + if (service_pid > 0) kill (service_pid, sig); eerrorx ("%s: caught %s, aborting", applet, signame); @@ -511,7 +511,7 @@ static bool svc_wait (rc_depinfo_t *depinfo, const char *svc) return (false); /* Some services don't have a timeout, like checkroot and checkfs */ - keywords = rc_deptree_depend (depinfo, svc, "keywords"); + keywords = rc_deptree_depend (depinfo, svc, "keywords"); STRLIST_FOREACH (keywords, s, i) { if (strcmp (s, "notimeout") == 0) { forever = true; @@ -765,8 +765,8 @@ static void svc_start (bool deps) STRLIST_FOREACH (tmplist, svc, i) { rc_service_schedule_start (svc, service); rc_strlist_free (providelist); - providelist = rc_deptree_depend (deptree, "iprovide", svc); - STRLIST_FOREACH (providelist, svc2, j) + providelist = rc_deptree_depend (deptree, "iprovide", svc); + STRLIST_FOREACH (providelist, svc2, j) rc_service_schedule_start (svc2, service); len += strlen (svc) + 2; @@ -856,7 +856,7 @@ static void svc_stop (bool deps) exit (EXIT_FAILURE); if (rc_yesno (getenv ("IN_HOTPLUG")) || in_background) - if (! (state & RC_SERVICE_STARTED) && + if (! (state & RC_SERVICE_STARTED) && ! (state & RC_SERVICE_INACTIVE)) exit (EXIT_FAILURE); @@ -900,12 +900,12 @@ static void svc_stop (bool deps) rc_strlist_reverse (services); STRLIST_FOREACH (services, svc, i) { rc_service_state_t svcs = rc_service_state (svc); - if (svcs & RC_SERVICE_STARTED || + if (svcs & RC_SERVICE_STARTED || svcs & RC_SERVICE_INACTIVE) { svc_wait (deptree, svc); svcs = rc_service_state (svc); - if (svcs & RC_SERVICE_STARTED || + if (svcs & RC_SERVICE_STARTED || svcs & RC_SERVICE_INACTIVE) { pid_t pid = rc_service_stop (svc); diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 901194e9..045080ea 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -7,7 +7,7 @@ system so we can monitor daemons a little. */ -/* +/* * Copyright 2007 Roy Marples * All rights reserved @@ -308,7 +308,7 @@ static int do_stop (const char *exec, const char *cmd, const char *pidfile, uid_t uid,int sig, bool quiet, bool verbose, bool test) { - pid_t *pids; + pid_t *pids; bool killed; int nkilled = 0; pid_t pid = 0; @@ -929,7 +929,7 @@ int start_stop_daemon (int argc, char **argv) *np++ = ':'; memcpy (np, token, sizeof (char) * strlen (token)); np += t; - *np = '\0'; + *np = '\0'; } else { l = strlen ("PATH=") + t + 1; newpath = xmalloc (sizeof (char) * l); -- cgit v1.2.3