* [lm-sensors] [PATCH 3/7] sensord: Coding style conversion (gnu ->
@ 2009-03-09 8:45 Andre Prendel
0 siblings, 0 replies; only message in thread
From: Andre Prendel @ 2009-03-09 8:45 UTC (permalink / raw)
To: lm-sensors
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-09 8:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-09 8:45 [lm-sensors] [PATCH 3/7] sensord: Coding style conversion (gnu -> Andre Prendel
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.