[GRASS-git] [OSGeo/grass] ee87f2: CQ: we should check the return value of lseek (#5783)

Māris Nartišs noreply at github.com
Sat Oct 25 12:51:19 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: ee87f21833475fd40805f58d1702f7d64478a27b
      https://github.com/OSGeo/grass/commit/ee87f21833475fd40805f58d1702f7d64478a27b
  Author: Māris Nartišs <maris.gis at gmail.com>
  Date:   2025-10-25 (Sat, 25 Oct 2025)

  Changed paths:
    M imagery/i.ortho.photo/i.ortho.rectify/readcell.c
    M imagery/i.rectify/readcell.c
    M imagery/i.segment/cluster.c
    M lib/gis/open.c
    M lib/gis/open_misc.c
    M lib/gis/seek.c
    M lib/raster/close.c
    M lib/raster/format.c
    M lib/raster/get_row.c
    M lib/raster/put_row.c
    M lib/raster3d/open.c
    M lib/raster3d/tilewrite.c
    M lib/segment/format.c
    M lib/segment/get_row.c
    M lib/segment/init.c
    M lib/segment/pagein.c
    M lib/segment/pageout.c
    M lib/segment/put_row.c
    M lib/segment/seek.c
    M lib/segment/setup.c
    M lib/vector/Vlib/break_polygons.c
    M lib/vector/rtree/index.c
    M lib/vector/rtree/io.c
    M raster/r.clump/clump.c
    M raster/r.clump/minsize.c
    M raster/r.compress/main.c
    M raster/r.drain/filldir.c
    M raster/r.drain/main.c
    M raster/r.drain/resolve.c
    M raster/r.drain/tinf.c
    M raster/r.fill.dir/dopolys.c
    M raster/r.fill.dir/filldir.c
    M raster/r.fill.dir/main.c
    M raster/r.fill.dir/ppupdate.c
    M raster/r.fill.dir/resolve.c
    M raster/r.fill.dir/tinf.c
    M raster/r.fill.dir/wtrshed.c
    M raster/r.grow.distance/main.c
    M raster/r.li/r.li.daemon/daemon.c
    M raster/r.mfilter/execute.c
    M raster/r.mfilter/getrow.c
    M raster/r.path/main.c
    M raster/r.proj/readcell.c
    M raster/r.random/count.c
    M raster/r.smooth.edgepreserve/row_cache.c
    M raster/r.thin/io.c
    M raster3d/r3.in.v5d/v5d.c
    M raster3d/r3.out.v5d/v5d.c

  Log Message:
  -----------
  CQ: we should check the return value of lseek (#5783)

An attempt to unify checks and error messages.

There are more places where `lseek` return value should be checked, but I don't have time to work on them now.

* CQ: we should check the return value of lseek
An attempt to unify checks and error messages

* r.random: remove unnecesarry lseek

Rewinding a raster map can lead to lseek errors and generally
should not be done, as raster reading functions perform seek
on their own if required.

* QA: add more checks for lseek return value

* QC: finish cleaning up lseek error handling:

* no need to cast -1 to off_t as we do not use K&R C
* make error message arguments relocable
* unify error messges
* add missing includes for error reporting

* Fix wording of error message on seek fail

* Clean up unintentional changes



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list