Re: [1/2]: Patch smsd/sqlite: Several bug fixes / optimizations

Pedro Aguilar <[email protected]>
Newsgroups gmane.linux.drivers.gnokii
Message-ID <CAEWWn28Ewwt=R_D7bD28hbZCMBaYjhKJkY9_u+OH-yhFx+MT2A@mail.gmail.com>
Hi,

Thanks for the feedback.

I changed the patch and it only checks if there were no errors in
WriteSMS().
The format should be ok now.

I'll send the other patch splitted as soon as I have some time.

Regards,
-- 
Pedro Aguilar
http://www.paguilar.org/blog

On Sat, Mar 23, 2013 at 12:21 PM, Daniele Forsi <[email protected]> wrote:

> 2013/3/23 Pedro Aguilar:
>
> > This patch skips the sleep(1) when there was no error in WriteSMS().
>
> I'll let Jan speak for this, but I wouldn't aplly this patch for two
> reasons:
>
> the line you added has tabs instead of spaces, just use what the
> surrounding lines use
>
> the check for the error variable in while() will always be true now
> since you break on the negated condition so you can use just
> while (numError++ < 3);
>
> --
> Daniele Forsi
>
> _______________________________________________
> gnokii-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/gnokii-users
>

_______________________________________________
gnokii-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/gnokii-users
02_skip_sleep_writesms_ok.patch (application/octet-stream, 751 B)
From 1d9042b366b98d0c685bb7d49dffea8eb71b9430 Mon Sep 17 00:00:00 2001
From: Pedro Aguilar <[email protected]>
Date: Tue, 26 Mar 2013 12:55:28 +0100
Subject: [PATCH] Skips the sleep(1) when there was no error in WriteSMS()

---
 smsd/sqlite.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/smsd/sqlite.c b/smsd/sqlite.c
index dd98f30..0639ec1 100644
--- a/smsd/sqlite.c
+++ b/smsd/sqlite.c
@@ -207,6 +207,8 @@ GNOKII_API gint DB_Look(const gchar * const phone)
         numError = 0;
         do {
             error = WriteSMS(&sms);
+            if (error == GN_ERR_NONE)
+                break;
             sleep(1);
         } while ((error == GN_ERR_TIMEOUT || error == GN_ERR_FAILED) && numError++ < 3);
 
-- 
1.7.9.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.