gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-15


From: Pawel Kot
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-152-gad3ffd0
Date: Sun, 30 Jan 2011 11:41:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  ad3ffd0c9213566a1cdad2009d848ea1851e3399 (commit)
      from  299ace3691a92a4fbc7341c2623e928fd59f8660 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=ad3ffd0c9213566a1cdad2009d848ea1851e3399


commit ad3ffd0c9213566a1cdad2009d848ea1851e3399
Author: Pawel Kot <address@hidden>
Date:   Sun Jan 30 12:40:17 2011 +0100

    Allow to set custom path to gnokii-errors in the config file.

diff --git a/ChangeLog b/ChangeLog
index e140ef8..2d120fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,7 +10,8 @@
     o fix calendar handling issues (few off-by-ones)    (Paweł Kot)
     o implement deletecalendarnote for series40 3rd+ Ed (Paweł Kot)
  * gnokii updates
-    o create path to .gnokii-errors even on Windows     (Paweł Kot)
+    o create path to gnokii-errors even on Windows      (Paweł Kot)
+    o allow to specify custom path for gnokii-errors    (Paweł Kot)
 
 0.6.30
 ======
diff --git a/Docs/sample/gnokiirc b/Docs/sample/gnokiirc
index 13ac522..1165131 100644
--- a/Docs/sample/gnokiirc
+++ b/Docs/sample/gnokiirc
@@ -207,16 +207,29 @@ smsc_timeout = 10
 [flags]
 #RM-237=3110c, DEFAULT_S40_30
 
+[gnokii]
+# Set this to the path where you want gnokii-errors to be stored.
+# gnokii-errors file stores the information about unhandled frames
+# received while communicating with gnokii.
+# The default paths are:
+#  on Windows: %APPDATA%\\gnokii
+#  on MacOS X: $HOME/Library/Logs/gnokii
+#  on everything else: $XDG_CACHE_HOME/gnokii or $HOME/.cache/gnokii
+# Do not include filename in the path.
+# Make sure that specified folder or directory exists. Otherwise the output
+# will be redirected to stderr.
+#gnokiierrorpath=.
+
+[xgnokii]
 # Set this to 1 if you want to break your phone with xgnokii. Works only
 # with few Nokia models and FBUS communication
-[xgnokii]
 allow_breakage = 0
 
+[gnokiid]
 # Set bindir to point to the location of the various gnokiid binaries.
 # In particular ensure that mgnokiidev is in this location, with
 # permissions 4750, owned by root, group gnokii.  Ensure you
 # are in the gnokii group and that the group exists...
-[gnokiid]
 bindir = /usr/local/sbin/
 
 # Any entries in the following two sections will be set as environment
diff --git a/gnokii/gnokii.c b/gnokii/gnokii.c
index dd87298..1dda4c8 100644
--- a/gnokii/gnokii.c
+++ b/gnokii/gnokii.c
@@ -311,44 +311,47 @@ static int install_log_handler(void)
        int home = 0;
 #endif
 
+       path = gn_cfg_get(gn_cfg_info, "gnokii", "errorlogpath");
+       if (!path) {
 #ifdef WIN32
-       basepath = getenv("APPDATA");
+               basepath = getenv("APPDATA");
 #elif __MACH__
-       basepath = getenv("HOME");
+               basepath = getenv("HOME");
 #else
 /* freedesktop.org compliancy: 
http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html */
 #define XDG_CACHE_HOME "/.cache" /* $HOME/.cache */
-       basepath = getenv("XDG_CACHE_HOME");
-       if (!basepath) {
-               basepath = getenv("HOME");
-               home = 1;
-       }
+               basepath = getenv("XDG_CACHE_HOME");
+               if (!basepath) {
+                       basepath = getenv("HOME");
+                       home = 1;
+               }
 #endif
-       if (!basepath)
-               path = ".";
-       else {
-               path = calloc(MAX_PATH_LEN, sizeof(char));
-               free_path = 1;
+               if (!basepath)
+                       path = ".";
+               else {
+                       path = calloc(MAX_PATH_LEN, sizeof(char));
+                       free_path = 1;
 #ifdef WIN32 /* Windows */
-               snprintf(path, MAX_PATH_LEN, "%s\\gnokii", basepath);
+                       snprintf(path, MAX_PATH_LEN, "%s\\gnokii", basepath);
 #elif __MACH__
-               snprintf(path, MAX_PATH_LEN, "%s/Library/Logs/gnokii", 
basepath);
+                       snprintf(path, MAX_PATH_LEN, "%s/Library/Logs/gnokii", 
basepath);
 #else
-               if (home) {
-                       snprintf(path, MAX_PATH_LEN, "%s%s/gnokii", basepath, 
XDG_CACHE_HOME);
-               } else {
-                       snprintf(path, MAX_PATH_LEN, "%s/gnokii", basepath);
-                }
+                       if (home) {
+                               snprintf(path, MAX_PATH_LEN, "%s%s/gnokii", 
basepath, XDG_CACHE_HOME);
+                       } else {
+                               snprintf(path, MAX_PATH_LEN, "%s/gnokii", 
basepath);
+                       }
 #endif
-       }
+               }
 
-       st = stat(basepath, &buf);
-       if (st)
+               st = stat(basepath, &buf);
+               if (st)
                mkdir(basepath, S_IRWXU);
 
-       st = stat(path, &buf);
-       if (st)
-               mkdir(path, S_IRWXU);
+               st = stat(path, &buf);
+               if (st)
+                       mkdir(path, S_IRWXU);
+       }
 
        snprintf(logname, sizeof(logname), "%s/%s", path, file);
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |    3 +-
 Docs/sample/gnokiirc |   17 ++++++++++++++-
 gnokii/gnokii.c      |   53 ++++++++++++++++++++++++++-----------------------
 3 files changed, 45 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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