guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/01: fport_seek: Eliminate a fruitless use of 'off_t_o


From: Mark H. Weaver
Subject: [Guile-commits] 01/01: fport_seek: Eliminate a fruitless use of 'off_t_or_off64_t'.
Date: Tue, 18 Jun 2019 03:37:42 -0400 (EDT)

mhw pushed a commit to branch stable-2.2
in repository guile.

commit a17b727963dd8c443f35be9b64b1625e9fa5eddf
Author: Mark H Weaver <address@hidden>
Date:   Tue Jun 18 03:28:18 2019 -0400

    fport_seek: Eliminate a fruitless use of 'off_t_or_off64_t'.
    
    This is a followup to commit 91ba73b397fcc2a36ae7e434522a924c7a8887d0.
    
    * libguile/fports.c (fport_seek): Use 'lseek' instead of
    'lseek_or_lseek64', and use 'scm_t_off' uniformly.  That's the type used
    in the function signature, and there's no benefit to using a wider type
    internally.  Remove the overflow check, which is no longer needed.
---
 libguile/fports.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libguile/fports.c b/libguile/fports.c
index 5de08d3..5f1bbb9 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -613,18 +613,13 @@ static scm_t_off
 fport_seek (SCM port, scm_t_off offset, int whence)
 {
   scm_t_fport *fp = SCM_FSTREAM (port);
-  off_t_or_off64_t result;
+  scm_t_off result;
 
-  result = lseek_or_lseek64 (fp->fdes, offset, whence);
+  result = lseek (fp->fdes, offset, whence);
 
   if (result == -1)
     scm_syserror ("fport_seek");
 
-  /* Check to make sure the result fits in scm_t_off,
-     which might be smaller than off_t_or_off64_t.  */
-  if (result > SCM_T_OFF_MAX)
-    scm_num_overflow ("fport_seek");
-
   return result;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]