ladcca-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ladcca] Small patch for config storage in lashd


From: Mark Vitek
Subject: [ladcca] Small patch for config storage in lashd
Date: Mon, 03 Oct 2005 12:27:31 -0400
User-agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513)

Fixes saving/restoring of config data on lashd server, which seems to have worked for numeric values but not string values.

Index: lashd/store.c
===================================================================
RCS file: /cvsroot/lash/lash/lashd/store.c,v
retrieving revision 1.2
diff -u -r1.2 store.c
--- lashd/store.c    15 Sep 2005 08:23:29 -0000    1.2
+++ lashd/store.c    3 Oct 2005 16:15:46 -0000
@@ -295,11 +295,11 @@
        return 1;
    }

-    if (size > 0) {
+    if (lash_config_get_value_size(config) > 0) {
        written =
            write(config_file, lash_config_get_value(config),
                  lash_config_get_value_size(config));
-        if (written == -1 || written < sizeof(size)) {
+ if (written == -1 || written < lash_config_get_value_size(config)) {
            fprintf(stderr,
"%s: error writing to config file '%s' in store '%s'!: %s\n",
                    __FUNCTION__, lash_config_get_key(config), store->dir,
@@ -575,7 +575,7 @@
        value = lash_malloc(value_size);

        err = read(config_file, value, value_size);
-        if (err == -1 || err < sizeof(size)) {
+        if (err == -1 || err < value_size) {
            fprintf(stderr,
"%s: error reading value size in config file '%s': %s\n",
                    __FUNCTION__, store_get_config_filename(store, key),

? Makefile.in
? aclocal.m4
? autom4te.cache
? config.guess
? config.h.in
? config.sub
? configure
? ltmain.sh
? clients/Makefile.in
? clients/control/Makefile.in
? clients/gtk_client/Makefile.in
? clients/panel/Makefile.in
? clients/save_button/Makefile.in
? clients/simple_client/Makefile.in
? clients/synth/Makefile.in
? docs/Makefile.in
? docs/lash-manual.info
? docs/lash-manual-html-one-page/Makefile.in
? docs/lash-manual-html-split/Makefile.in
? icons/Makefile.in
? lash/Makefile.in
? lashd/Makefile.in
? lashd/saved_store.c
? liblash/Makefile.in
? m4/Makefile.in
Index: lashd/store.c
===================================================================
RCS file: /cvsroot/lash/lash/lashd/store.c,v
retrieving revision 1.2
diff -u -r1.2 store.c
--- lashd/store.c       15 Sep 2005 08:23:29 -0000      1.2
+++ lashd/store.c       3 Oct 2005 16:15:46 -0000
@@ -295,11 +295,11 @@
                return 1;
        }
 
-       if (size > 0) {
+       if (lash_config_get_value_size(config) > 0) {
                written =
                        write(config_file, lash_config_get_value(config),
                                  lash_config_get_value_size(config));
-               if (written == -1 || written < sizeof(size)) {
+               if (written == -1 || written < 
lash_config_get_value_size(config)) {
                        fprintf(stderr,
                                        "%s: error writing to config file '%s' 
in store '%s'!: %s\n",
                                        __FUNCTION__, 
lash_config_get_key(config), store->dir,
@@ -575,7 +575,7 @@
                value = lash_malloc(value_size);
 
                err = read(config_file, value, value_size);
-               if (err == -1 || err < sizeof(size)) {
+               if (err == -1 || err < value_size) {
                        fprintf(stderr,
                                        "%s: error reading value size in config 
file '%s': %s\n",
                                        __FUNCTION__, 
store_get_config_filename(store, key),

reply via email to

[Prev in Thread] Current Thread [Next in Thread]