[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -1,13 +1,10 @@
<services>
- <service name="webhook">
- <param name="repourl">https://github.com/nemomobile/mce-plugin-libhybris.git</param>
+ <service name="tar_git">
+ <param name="url">https://github.com/nemomobile/mce-plugin-libhybris.git</param>
<param name="branch">master</param>
+ <param name="revision">HEAD</param>
+ <param name="token"/>
+ <param name="debian">N</param>
+ <param name="dumb">N</param>
</service>
-<service name="tar_git">
- <param name="url">https://github.com/nemomobile/mce-plugin-libhybris.git</param>
- <param name="branch">master</param>
- <param name="revision">3e4e459f47f5cb995172e4141834b89012024039</param>
- <param name="token"/>
- <param name="debian">N</param>
- <param name="dumb">N</param>
-</service></services>
+</services>
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-bacon.c
^
|
@@ -40,6 +40,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -306,6 +307,7 @@
led_paths_bacon_t paths[BACON_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < BACON_CHANNELS; ++i )
objconf_init(bacon_conf, &paths[i]);
@@ -314,7 +316,7 @@
if( !objconf_parse(bacon_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_bacon_probe(channel+0, &paths[i]) )
+ if( !led_channel_bacon_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-binary.c
^
|
@@ -39,6 +39,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -104,10 +105,10 @@
{
bool res = false;
- if( !sysfsval_open(self->cached_brightness, path->brightness) )
+ if( !sysfsval_open_rw(self->cached_brightness, path->brightness) )
goto cleanup;
- if( sysfsval_open(self->cached_max_brightness, path->max_brightness) )
+ if( sysfsval_open_ro(self->cached_max_brightness, path->max_brightness) )
sysfsval_refresh(self->cached_max_brightness);
if( sysfsval_get(self->cached_max_brightness) <= 0 )
@@ -212,6 +213,7 @@
led_paths_binary_t paths[BINARY_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < BINARY_CHANNELS; ++i )
objconf_init(binary_conf, &paths[i]);
@@ -219,7 +221,7 @@
if( !objconf_parse(binary_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_binary_probe(channel+0, &paths[i]) )
+ if( !led_channel_binary_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-f5121.c
^
|
@@ -40,6 +40,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -123,10 +124,10 @@
* Practically all led control directories have 'brightness'
* file, most have 'max_brightness' while only some have 'blink'.
*/
- if( !sysfsval_open(self->cached_blink, path->blink) )
+ if( !sysfsval_open_rw(self->cached_blink, path->blink) )
goto cleanup;
- if( !sysfsval_open(self->cached_max_brightness, path->max_brightness) )
+ if( !sysfsval_open_ro(self->cached_max_brightness, path->max_brightness) )
goto cleanup;
/* The 'max_brightness' seems to be dynamic. Make an attempt
@@ -140,7 +141,7 @@
if( sysfsval_get(self->cached_max_brightness) <= 0 )
goto cleanup;
- if( !sysfsval_open(self->cached_brightness, path->brightness) )
+ if( !sysfsval_open_rw(self->cached_brightness, path->brightness) )
goto cleanup;
ack = true;
@@ -324,6 +325,7 @@
led_paths_f5121_t paths[F5121_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < F5121_CHANNELS; ++i )
objconf_init(f5121_conf, &paths[i]);
@@ -332,7 +334,7 @@
if( !objconf_parse(f5121_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_f5121_probe(channel+0, &paths[i]) )
+ if( !led_channel_f5121_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-hammerhead.c
^
|
@@ -44,6 +44,7 @@
#include <stdio.h>
#include <unistd.h>
+#include <string.h>
#include <glib.h>
@@ -283,6 +284,7 @@
led_paths_hammerhead_t paths[HAMMERHEAD_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < HAMMERHEAD_CHANNELS; ++i )
objconf_init(hammerhead_conf, &paths[i]);
@@ -291,7 +293,7 @@
if( !objconf_parse(hammerhead_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_hammerhead_probe(channel+0, &paths[i]) )
+ if( !led_channel_hammerhead_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-htcvision.c
^
|
@@ -42,6 +42,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -115,13 +116,13 @@
{
bool res = false;
- if( !sysfsval_open(self->cached_blink, path->blink) )
+ if( !sysfsval_open_rw(self->cached_blink, path->blink) )
goto cleanup;
- if( !sysfsval_open(self->cached_brightness, path->brightness) )
+ if( !sysfsval_open_rw(self->cached_brightness, path->brightness) )
goto cleanup;
- if( sysfsval_open(self->cached_max_brightness, path->max_brightness) )
+ if( sysfsval_open_ro(self->cached_max_brightness, path->max_brightness) )
sysfsval_refresh(self->cached_max_brightness);
if( sysfsval_get(self->cached_max_brightness) <= 0 )
@@ -278,6 +279,7 @@
led_paths_htcvision_t paths[HTCVISION_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < HTCVISION_CHANNELS; ++i )
objconf_init(htcvision_conf, &paths[i]);
@@ -286,7 +288,7 @@
if( !objconf_parse(htcvision_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_htcvision_probe(channel+0, &paths[i]) )
+ if( !led_channel_htcvision_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-redgreen.c
^
|
@@ -40,6 +40,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -105,10 +106,10 @@
{
bool res = false;
- if( !sysfsval_open(self->cached_brightness, path->brightness) )
+ if( !sysfsval_open_rw(self->cached_brightness, path->brightness) )
goto cleanup;
- if( sysfsval_open(self->cached_max_brightness, path->max_brightness) )
+ if( sysfsval_open_ro(self->cached_max_brightness, path->max_brightness) )
sysfsval_refresh(self->cached_max_brightness);
if( sysfsval_get(self->cached_max_brightness) <= 0 )
@@ -235,6 +236,7 @@
led_paths_redgreen_t paths[REDGREEN_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < REDGREEN_CHANNELS; ++i )
objconf_init(redgreen_conf, &paths[i]);
@@ -243,7 +245,7 @@
if( !objconf_parse(redgreen_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_redgreen_probe(channel+0, &paths[i]) )
+ if( !led_channel_redgreen_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-vanilla.c
^
|
@@ -51,6 +51,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -137,7 +138,7 @@
bool res = false;
// maximum brightness can be read from file or given in config
- if( sysfsval_open(self->cached_max_brightness, path->max_brightness) )
+ if( sysfsval_open_ro(self->cached_max_brightness, path->max_brightness) )
sysfsval_refresh(self->cached_max_brightness);
if( path->max_override > 0 )
@@ -147,18 +148,18 @@
goto cleanup;
// we always must have brightness control
- if( !sysfsval_open(self->cached_brightness, path->brightness) )
+ if( !sysfsval_open_rw(self->cached_brightness, path->brightness) )
goto cleanup;
// on/off period controls are optional, but both
// are needed if one is present
- if( sysfsval_open(self->cached_blink_delay_on, path->blink_delay_on) ) {
- if( !sysfsval_open(self->cached_blink_delay_off, path->blink_delay_off) )
+ if( sysfsval_open_rw(self->cached_blink_delay_on, path->blink_delay_on) ) {
+ if( !sysfsval_open_rw(self->cached_blink_delay_off, path->blink_delay_off) )
sysfsval_close(self->cached_blink_delay_on);
}
// having "blink" control file is optional
- sysfsval_open(self->cached_blink, path->blink);
+ sysfsval_open_rw(self->cached_blink, path->blink);
res = true;
@@ -370,6 +371,7 @@
led_paths_vanilla_t paths[VANILLA_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < VANILLA_CHANNELS; ++i )
objconf_init(vanilla_conf, &paths[i]);
@@ -378,7 +380,7 @@
if( !objconf_parse(vanilla_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_vanilla_probe(channel+0, &paths[i]) )
+ if( !led_channel_vanilla_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-led-white.c
^
|
@@ -36,6 +36,7 @@
#include "plugin-config.h"
#include <stdio.h>
+#include <string.h>
#include <glib.h>
@@ -101,10 +102,10 @@
{
bool res = false;
- if( !sysfsval_open(self->cached_brightness, path->brightness) )
+ if( !sysfsval_open_rw(self->cached_brightness, path->brightness) )
goto cleanup;
- if( !sysfsval_open(self->cached_max_brightness, path->max_brightness) )
+ if( !sysfsval_open_ro(self->cached_max_brightness, path->max_brightness) )
goto cleanup;
sysfsval_refresh(self->cached_max_brightness);
@@ -212,6 +213,7 @@
led_paths_white_t paths[WHITE_CHANNELS];
+ memset(paths, 0, sizeof paths);
for( size_t i = 0; i < WHITE_CHANNELS; ++i )
objconf_init(white_conf, &paths[i]);
@@ -219,7 +221,7 @@
if( !objconf_parse(white_conf, &paths[i], pfix[i]) )
goto cleanup;
- if( !led_channel_white_probe(channel+0, &paths[i]) )
+ if( !led_channel_white_probe(channel+i, &paths[i]) )
goto cleanup;
}
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-val.c
^
|
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
+#include <errno.h>
/* ========================================================================= *
* TYPES
@@ -51,7 +52,9 @@
sysfsval_t *sysfsval_create (void);
void sysfsval_delete (sysfsval_t *self);
-bool sysfsval_open (sysfsval_t *self, const char *path);
+bool sysfsval_open_rw (sysfsval_t *self, const char *path);
+bool sysfsval_open_ro (sysfsval_t *self, const char *path);
+static bool sysfsval_open_ex (sysfsval_t *self, const char *path, mode_t mode);
void sysfsval_close (sysfsval_t *self);
const char *sysfsval_path (const sysfsval_t *self);
int sysfsval_get (const sysfsval_t *self);
@@ -110,14 +113,32 @@
}
}
-/** Assign path to sysfsval_t object and attempt to open the file
+/** Assign path to sysfsval_t object and open the file in read+write mode
*
* @param self sysfsval_t object pointer
*
* @return true if file was opened succesfully, false otherwise
*/
bool
-sysfsval_open(sysfsval_t *self, const char *path)
+sysfsval_open_rw(sysfsval_t *self, const char *path)
+{
+ return sysfsval_open_ex(self, path, O_RDWR);
+}
+
+/** Assign path to sysfsval_t object and open the file in read-only mode
+ *
+ * @param self sysfsval_t object pointer
+ *
+ * @return true if file was opened succesfully, false otherwise
+ */
+bool
+sysfsval_open_ro(sysfsval_t *self, const char *path)
+{
+ return sysfsval_open_ex(self, path, O_RDONLY);
+}
+
+static bool
+sysfsval_open_ex(sysfsval_t *self, const char *path, mode_t mode)
{
bool ack = false;
@@ -129,8 +150,13 @@
if( (self->sv_path = strdup(path)) == 0 )
goto EXIT;
- if( (self->sv_file = open(path, O_RDWR)) == -1 )
+ if( (self->sv_file = open(path, mode)) == -1 ) {
+ if( errno == ENOENT )
+ mce_log(LOG_DEBUG, "%s: open: %m", path);
+ else
+ mce_log(LOG_ERR, "%s: open: %m", path);
goto EXIT;
+ }
mce_log(LOG_DEBUG, "%s: opened", sysfsval_path(self));
|
[-]
[+]
|
Changed |
_service:tar_git:mce-plugin-libhybris-1.12.1.tar.bz2/sysfs-val.h
^
|
@@ -38,7 +38,8 @@
sysfsval_t *sysfsval_create (void);
void sysfsval_delete (sysfsval_t *self);
-bool sysfsval_open (sysfsval_t *self, const char *path);
+bool sysfsval_open_rw (sysfsval_t *self, const char *path);
+bool sysfsval_open_ro (sysfsval_t *self, const char *path);
void sysfsval_close (sysfsval_t *self);
const char *sysfsval_path (const sysfsval_t *self);
int sysfsval_get (const sysfsval_t *self);
|