[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "segmentation fault" (GOOD PATCH HERE (i hope))
From: |
Carles Pina i Estany |
Subject: |
Re: "segmentation fault" (GOOD PATCH HERE (i hope)) |
Date: |
Sun, 1 Sep 2002 22:23:56 +0200 (CEST) |
Grrrr!!!
I have sent the incorrect version and the incorrect patch
diff -u -p gnokii_old.c gnokii.c
--- gnokii_old.c Sun Sep 1 22:12:27 2002
+++ gnokii.c Sun Sep 1 22:20:00 2002
@@ -4167,6 +4167,12 @@ static GSM_Error smsslave(GSM_API_SMS *m
fprintf(stderr, _("### Exists?!\n"));
return GE_FAILED;
}
+
+ if (mkdir ("/tmp/sms",0)==0) {
+ fprintf(stderr,_("Cannot create temporary directori
/tmp/sms\n"));
+ exit (234);
+ }
+
output = fopen(buf, "w+");
/* Skip formatting chars */
@@ -4183,6 +4189,7 @@ static GSM_Error smsslave(GSM_API_SMS *m
fprintf(output, "%s", s);
}
fclose(output);
+ rmdir ("/tmp/sms");
return GE_NONE;
}
(In the other version there was some syntax error, excuse me)
On Sun, 1 Sep 2002, Carles Pina i Estany wrote:
>
> Hi,
>
> Here is the patch... (I hope...)
>
> carles:/home/carles/down/nokia/cvs/gnokii/gnokii# diff -u -p gnokii_old.c
> gnokii.c
> --- gnokii_old.c Sun Sep 1 22:12:27 2002
> +++ gnokii.c Sun Sep 1 22:07:46 2002
> @@ -4167,6 +4167,12 @@ static GSM_Error smsslave(GSM_API_SMS *m
> fprintf(stderr, _("### Exists?!\n"));
> return GE_FAILED;
> }
> +
> + if (mkdir ("/tmp/sms")==0) {
> + fprintf(stderr,_("Cannot create temporary directori
> /tmp/sms\n");
> + exit (234);
> + }
> +
> output = fopen(buf, "w+");
>
> /* Skip formatting chars */
> @@ -4183,6 +4189,7 @@ static GSM_Error smsslave(GSM_API_SMS *m
> fprintf(output, "%s", s);
> }
> fclose(output);
> + rmmdir ("/tmp/sms");
> return GE_NONE;
> }
>
> Somebody change the exit code to the exit good way to exit from gnokii
> (close the port, etc.)
>
>
> On Sun, 1 Sep 2002, Carles Pina i Estany wrote:
>
> >
> > Hi,
> >
> > > Doing gnokii --smsreader, with gnokii-0.4.3 and gnokii from CVS:
> >
> > in gnokii/gnokii.c, in line 4170, gnokii opens a file in /tmp/sms . And
> > /tmp/sms directory don't exist, then do segmentation fault. If I do mkdir
> > /tmp/sms then works.
> >
> > With this in line 4171 from gnokii.c
> >
> > if (mkdir ("/tmp/sms")==0) {
> > fprintf(stderr,_("Cannot create temporary directori
> > /tmp/sms\n");
> > exit (234);
> > }
> >
> > and, before "return GE_NONE;"
> >
> > rmmdir ("/tmp/sms");
> >
> > works fine
> >
> >
> > >
> > > SMS received from number: 787
> > > Got message 1: www.vizzavi.es#carles disculpa bla bla bla
> > > ("confidential" message ;-)) )
> > > ViolaciĆ³n de segmento
> > > carles:/home/carles/down/nokia/cvs/gnokii#
> > >
> > > (violaciĆ³n de segmento=segmentation fault in spanish)
> > >
> > > ----
> > > Carles Pina i Estany || address@hidden address@hidden
> > > http://www.pinux.info
> > > http://www.salleurl.edu/~is08139
> > >
> > >
> > >
> > > _______________________________________________
> > > gnokii-users mailing list
> > > address@hidden
> > > http://mail.freesoftware.fsf.org/mailman/listinfo/gnokii-users
> > >
> >
> > ----
> > Carles Pina i Estany || address@hidden address@hidden
> > http://www.pinux.info
> > http://www.salleurl.edu/~is08139
> >
> >
> >
> > _______________________________________________
> > gnokii-users mailing list
> > address@hidden
> > http://mail.freesoftware.fsf.org/mailman/listinfo/gnokii-users
> >
>
> ----
> Carles Pina i Estany || address@hidden address@hidden
> http://www.pinux.info
> http://www.salleurl.edu/~is08139
>
>
>
> _______________________________________________
> gnokii-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/gnokii-users
>
----
Carles Pina i Estany || address@hidden address@hidden
http://www.pinux.info
http://www.salleurl.edu/~is08139