[FFmpeg-cvslog] r12607 - trunk/libavformat/mov.c

Michael Niedermayer michaelni
Thu Mar 27 19:22:00 CET 2008


On Thu, Mar 27, 2008 at 05:48:14PM -0000, M?ns Rullg?rd wrote:
> 
> Michael Niedermayer wrote:
> > On Thu, Mar 27, 2008 at 02:30:31PM +0100, bcoudurier wrote:
> >> Author: bcoudurier
> >> Date: Thu Mar 27 14:30:31 2008
> >> New Revision: 12607
> >>
> >> Log:
> >> print essence path in error message
> >>
> >> Modified:
> >>    trunk/libavformat/mov.c
> >>
> >> Modified: trunk/libavformat/mov.c
> >> ==============================================================================
> >> --- trunk/libavformat/mov.c	(original)
> >> +++ trunk/libavformat/mov.c	Thu Mar 27 14:30:31 2008
> >> @@ -1259,8 +1259,8 @@ static int mov_read_trak(MOVContext *c,
> >>
> >>      if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
> >>          if (url_fopen(&sc->pb, sc->drefs[sc->dref_id-1].path, URL_RDONLY) < 0)
> >> -            av_log(c->fc, AV_LOG_ERROR, "stream %d, error opening external
> >> essence: %s\n",
> >> -                   st->index, strerror(errno));
> >> +            av_log(c->fc, AV_LOG_ERROR, "stream %d, error opening file %s:
> >> %s\n",
> >> +                   st->index, sc->drefs[sc->dref_id-1].path, strerror(errno));
> >
> > not related to this commit but we cannot call strerror()
> > The docs say:
> >  -- Function: char * strerror (int ERRNUM)
> > [...]
> >      You should not modify the string returned by `strerror'.  Also, if
> >      you make subsequent calls to `strerror', the string might be
> >      overwritten.  (But it's guaranteed that no library function ever
> >                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >      calls `strerror' behind your back.)
> >      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> I don't know where you found that.  It looks a bit like the glibc info
> page.  When quoting standards, please go the to real text.

Yes its from the glibc info page, sorry, i didnt think much about it.
I just knew it was bad to call such things due to changing global state,
and wanted to quote something ...


[...]
> That said, it is of course good practise of any library to not modify
> global state, so we should avoid using strerror().

Yes, exactly.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080327/ada0f370/attachment.pgp>



More information about the ffmpeg-cvslog mailing list