opnsense-src/lib
Faraz Vahedi f144058b40 Refactor error handling in lseek operations
1. Subtraction was performed on the current position
   regardless of the success of the lseek operation.
   In the event of an error, this resulted in the
   current position being erroneously set to -2,
   which bypassed the intended error handling
   mechanism. The proposed change performs error
   checking immediately following the lseek operation,
   prior to any modification of the current position.
   This ensures that a failed lseek operation will
   correctly trigger the appropriate error handling.

2. The error checking logic was based on the assumption
   that lseek would return `offset - 1` upon failure.
   However, this is not consistent with the behaviour of
   lseek as specified in the POSIX standard, which
   stipulates that lseek shall return -1 in case of
   an error. The code has been updated to reflect this
   standard, improving reliability and compliance.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1392
2024-09-21 05:25:15 -06:00
..
atf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
clang Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
csu csu: add include path to CFLAGS to be able to find libsys.h 2024-09-19 15:36:38 -04:00
geom gpart: Add u-boot-env alias for U-Boot's environment GPT partition UUID 2024-09-02 23:21:18 +01:00
googletest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
lib9p Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
lib80211 lib80211: Consistently use item count as the first argument to calloc 2024-07-19 13:06:16 -04:00
libalias Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libarchive libarchive: fix thread autodetermination for zstd compression format 2024-05-03 15:39:37 +02:00
libauditd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
libbe zfs: merge openzfs/zfs@b10992582 2024-09-09 18:13:02 +02:00
libbearssl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbegemot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libblacklist Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libblocksruntime Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbluetooth Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libbsddialog dirdeps: Update Makefile.depend* files with empty contents 2023-10-29 17:01:04 -04:00
libbsdstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbsm package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
libbsnmp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libbz2 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libc printf(): Save errno earlier. 2024-09-20 18:30:39 +02:00
libc++ Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libc++experimental Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libc_nonshared Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcalendar Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcam Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcapsicum Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcasper manuals: Misc macro typos 2024-09-21 05:25:15 -06:00
libcbor Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libclang_rt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcom_err Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcompat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcompiler_rt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcrypt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libcuse Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libcxxrt libcxxrt: Add a stub implementation of __cxa_call_terminate 2024-08-21 13:37:48 -04:00
libdevctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdevdctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdevinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdevstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdiff diff: Nits in tests. 2024-05-20 16:27:50 +02:00
libdl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdpv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libdwarf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libedit Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libefivar libefivar: Fix AcpiEx print logic 2024-09-06 12:34:33 -06:00
libelf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libelftc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libevent1 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libexecinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libexpat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libfdt libfdt: Make an internal FDT library available 2024-03-21 01:05:05 -04:00
libfetch libfetch: don't include fragments in HTTP requests 2024-08-21 12:35:27 +00:00
libfido2 libfido2: update to 1.14.0 2024-05-04 12:51:08 -04:00
libfigpar Refactor error handling in lseek operations 2024-09-21 05:25:15 -06:00
libgcc_eh Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libgcc_s Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libgeom libgeom: Avoid fixed remappings of the devstat device 2024-08-19 16:02:59 +00:00
libgpio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libgssapi Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libiconv_modules Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libifconfig Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libipsec libipsec: decode SADB_X_EXT_IF_HW_OFFL 2024-07-12 06:29:31 +03:00
libipt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libiscsiutil lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libjail Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libkiconv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libkvm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libldns Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblua Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblutok Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblzma Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmagic libmagic: Use HOST_CC when compiling hostprog used by build 2024-03-27 19:18:43 -04:00
libmd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmemstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmilter Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmixer mixer.3: Fix mixer_get_mode() description 2024-08-05 14:13:44 +03:00
libmp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libmt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libnetbsd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libnetgraph lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libnetmap libnetmap: remove interface name validation 2023-12-21 14:43:57 +00:00
libnv libnv: add tests to verify potential overflow issues 2024-09-04 13:43:16 +02:00
libnvmf libnvmf: Reject invalid values of MAXH2CDATA for new associations 2024-07-25 15:32:42 -04:00
libomp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libopenbsd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libopencsd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libpam pam_xdg: Fix user xdg runtime directory's descriptor leak 2024-08-30 16:08:14 +02:00
libpathconv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libpcap libpcap: Add changes missed in update to 1.10.5 2024-09-14 14:35:58 -03:00
libpe Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libpfctl pf: allow filtering on the receive interface 2024-09-16 13:47:07 +02:00
libpjdlog lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libpmc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libpmcstat lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libproc Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
libprocstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libradius radlib: fix a memory leak in is_valid_request 2024-06-04 19:40:55 -07:00
libregex Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
librpcsec_gss Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
librpcsvc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
librss Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
librt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
librtld_db Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
libsbuf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsdp Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
libsecureboot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsmb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsmdb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsmutil Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsqlite3 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libssp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libssp_nonshared Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libstats Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libstdbuf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libstdthreads Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsys manuals: Misc macro typos 2024-09-21 05:25:15 -06:00
libsysdecode Remove a ktrace.out which snuck into an earlier commit 2024-09-10 17:52:43 +00:00
libtacplus lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
libtelnet Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libthr Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
libthread_db Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
libucl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libufs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libugidfw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libulog Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libunbound unbound: Vendor import 1.21.0 2024-08-16 10:03:34 -07:00
libusb libusb: claim to be version 1.0.16 2024-06-28 12:18:34 -04:00
libusbhid libusbhid: add missing include guards 2024-06-06 10:09:05 -04:00
libutil libutil: support RLIMIT_PIPEBUF 2024-09-20 09:46:06 +03:00
libveriexec Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libvgl lib/libvgl/main.c: remove an extra semicolon 2024-02-02 18:35:01 -07:00
libvmmapi libvmmapi: Conditionalize compilation of some functions 2024-04-10 11:17:56 -04:00
libwrap Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libxo Install xo_emit_f.3 2024-09-21 05:25:15 -06:00
liby Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libypclnt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libz dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
libzstd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
msun Improve accuracy of asinf(3) and acosf(3) 2024-08-29 21:44:48 +02:00
ncurses Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nss_tacplus nss_tacplus: Provide dummy setpwent(), getpwent_r(), endpwent(). 2023-08-31 07:49:57 +00:00
ofed Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile flua: move modules source into the main source directory 2024-09-12 09:03:44 +02:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00