#2278: G__tempfile() lacks perror support
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: LibGIS | Version: svn-releasebranch70
Keywords: r.hants | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Comment(by glynn):
Replying to [comment:4 neteler]:
> > Ideally, strerror() (or similar) should be used, and the string
included in
> > the error message.
>
> Done by mmetz in r60148 and related.
For robustness, errno should be copied to a local variable immediately
after the failed call, e.g.:
{{{
fcb->null_fd = creat(tempname, 0666);
if (fcb->null_fd < 0) {
int err = errno;
...
G_fatal_error(_("No temp files available: %s"), strerror(err));
}
}}}
Otherwise, it may be modified by an intervening call (specifically,
close() can modify errno).
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2278#comment:5>
GRASS GIS <http://grass.osgeo.org>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev