[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smsreader problem
From: |
Pawel Kot |
Subject: |
Re: smsreader problem |
Date: |
Sat, 13 Apr 2002 16:11:03 +0200 (CEST) |
Hi,
On Sat, 13 Apr 2002, Bostjan Muller wrote:
> I am trying to make smsreader work with nokia 5110, and it receives the
> message ok, but does not write anything to the disk (/tmp/sms directory
> remains empty, allthough I have all permissions to write in there).
> I have run a strace on the gnokii and this is what happenes:
>
> <strace snip>
> write(2, "Got message 1: Test\n", 20Got message 1: Test
> ) = 20
> getpid() = 9572
> open("/tmp/sms/unknown_9572_0", O_RDONLY) = -1 ENOENT (No such file or
> directory
> )
> write(2, "### Exists?!\n", 13### Exists?!
> ) = 13
> write(5, "\36\0\f\24\0\10\0\1\0\n\2\1\1F\21P", 16) = 16
> </strace snip>
Well, this is the sanity check with a typo.
> As I could understand from the gnokii.c this error should
> only appeare if buf could not be opened for reading?, but what is buf?
> where is it created?
No. gnokii checks first it the message already exists. If it does not it
attepts to save it. But the check is done incorrectly.
> Can someone please help me make this smsreader work?
Try this:
--- gnokii/gnokii.c~ Sat Apr 13 16:13:02 2002
+++ gnokii/gnokii.c Sat Apr 13 16:13:02 2002
@@ -3380,7 +3380,7 @@
else if (sscanf(s, "%d/%d:%d-%d-", &i1, &i2, &msgno, &msgpart) == 4)
sprintf(buf, "/tmp/sms/mail_%d_%03d", msgno, msgpart);
else sprintf(buf, "/tmp/sms/unknown_%d_%d", getpid(), unknown++);
- if ((output = fopen(buf, "r")) == NULL) {
+ if ((output = fopen(buf, "r")) != NULL) {
fprintf(stderr, _("### Exists?!\n"));
return GE_CANTOPENFILE;
}
pkot
--
mailto:address@hidden :: mailto:address@hidden
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku