From: Andre Prendel <andre_prendel@gmx.de>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH 3/7] sensord: Coding style conversion (gnu ->
Date: Mon, 09 Mar 2009 08:45:38 +0000 [thread overview]
Message-ID: <20090309084538.GD4636@ubuntu> (raw)
Fix coding style in lib.c
---
prog/sensord/lib.c | 119 +++++++++++++++++++++++++++--------------------------
1 file changed, 61 insertions(+), 58 deletions(-)
--- quilt-sensors.orig/prog/sensord/lib.c 2009-03-06 16:24:55.000000000 +0100
+++ quilt-sensors/prog/sensord/lib.c 2009-03-08 18:19:28.000000000 +0100
@@ -32,69 +32,72 @@
#include "sensord.h"
#include "lib/error.h"
-static int
-loadConfig
-(const char *cfgPath, int reload) {
- struct stat stats;
- FILE *cfg = NULL;
- int ret = 0;
-
- if (cfgPath && !strcmp (cfgPath, "-")) {
- if (!reload) {
- if ((ret = sensors_init (stdin))) {
- sensorLog (LOG_ERR, "Error loading sensors configuration file <stdin>: %s",
- sensors_strerror (ret));
- ret = 12;
- }
- }
- } else if (cfgPath && stat (cfgPath, &stats) < 0) {
- sensorLog (LOG_ERR, "Error stating sensors configuration file: %s", cfgPath);
- ret = 10;
- } else {
- if (reload) {
- sensorLog (LOG_INFO, "configuration reloading");
- sensors_cleanup ();
- }
- if (cfgPath && !(cfg = fopen (cfgPath, "r"))) {
- sensorLog (LOG_ERR, "Error opening sensors configuration file: %s", cfgPath);
- ret = 11;
- } else if ((ret = sensors_init (cfg))) {
- sensorLog (LOG_ERR, "Error loading sensors configuration file %s: %s",
- cfgPath ? cfgPath : "(default)", sensors_strerror (ret));
- ret = 11;
- }
- if (cfg)
- fclose (cfg);
- }
+static int loadConfig(const char *cfgPath, int reload)
+{
+ struct stat stats;
+ FILE *cfg = NULL;
+ int ret = 0;
+
+ if (cfgPath && !strcmp(cfgPath, "-")) {
+ if (!reload) {
+ if ((ret = sensors_init(stdin))) {
+ sensorLog(LOG_ERR,
+ "Error loading sensors configuration file <stdin>: %s",
+ sensors_strerror(ret));
+ ret = 12;
+ }
+ }
+ } else if (cfgPath && stat(cfgPath, &stats) < 0) {
+ sensorLog(LOG_ERR,
+ "Error stating sensors configuration file: %s",
+ cfgPath);
+ ret = 10;
+ } else {
+ if (reload) {
+ sensorLog(LOG_INFO, "configuration reloading");
+ sensors_cleanup();
+ }
+ if (cfgPath && !(cfg = fopen(cfgPath, "r"))) {
+ sensorLog(LOG_ERR,
+ "Error opening sensors configuration file: %s",
+ cfgPath);
+ ret = 11;
+ } else if ((ret = sensors_init(cfg))) {
+ sensorLog(LOG_ERR,
+ "Error loading sensors configuration file %s: %s",
+ cfgPath ? cfgPath : "(default)",
+ sensors_strerror(ret));
+ ret = 11;
+ }
+ if (cfg)
+ fclose(cfg);
+ }
- return ret;
+ return ret;
}
-int
-loadLib
-(const char *cfgPath) {
- int ret;
- ret = loadConfig (cfgPath, 0);
- if (!ret)
- ret = initKnownChips ();
- return ret;
+int loadLib(const char *cfgPath)
+{
+ int ret;
+ ret = loadConfig(cfgPath, 0);
+ if (!ret)
+ ret = initKnownChips();
+ return ret;
}
-int
-reloadLib
-(const char *cfgPath) {
- int ret;
- freeKnownChips ();
- ret = loadConfig (cfgPath, 1);
- if (!ret)
- ret = initKnownChips ();
- return ret;
+int reloadLib(const char *cfgPath)
+{
+ int ret;
+ freeKnownChips();
+ ret = loadConfig(cfgPath, 1);
+ if (!ret)
+ ret = initKnownChips();
+ return ret;
}
-int
-unloadLib
-(void) {
- freeKnownChips ();
- sensors_cleanup ();
- return 0;
+int unloadLib(void)
+{
+ freeKnownChips();
+ sensors_cleanup();
+ return 0;
}
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
reply other threads:[~2009-03-09 8:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090309084538.GD4636@ubuntu \
--to=andre_prendel@gmx.de \
--cc=lm-sensors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.