bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] [PATCH] Don't inhibit large file support.


From: Eric Blake
Subject: [Bug-tar] [PATCH] Don't inhibit large file support.
Date: Sat, 6 Feb 2010 13:26:50 -0700

tar should always use fseeko, not fseek, to avoid arbitrary limits
on 32-bit platforms.  Noticed from a gnulib compilation warning.

* src/incremen.c (write_directory_file): Use fseeko.
* scripts/xsparse.c (read_map): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 scripts/xsparse.c |    6 +++---
 src/incremen.c    |    5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/xsparse.c b/scripts/xsparse.c
index c77c3f5..cf621ad 100644
--- a/scripts/xsparse.c
+++ b/scripts/xsparse.c
@@ -1,7 +1,7 @@
 /* xsparse - expands compressed sparse file images extracted from GNU tar
    archives.

-   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.

    Written by Sergey Poznyakoff
    
@@ -279,8 +279,8 @@ read_map (FILE *ifp)
       sparse_map[i].numbytes = string_to_size (nbuf, NULL);
     }

-  fseek (ifp, ((ftell (ifp) + BLOCKSIZE - 1) / BLOCKSIZE) * BLOCKSIZE,
-        SEEK_SET);
+  fseeko (ifp, ((ftell (ifp) + BLOCKSIZE - 1) / BLOCKSIZE) * BLOCKSIZE,
+         SEEK_SET);
 }  

 void
diff --git a/src/incremen.c b/src/incremen.c
index 7cad838..33ca934 100644
--- a/src/incremen.c
+++ b/src/incremen.c
@@ -1,7 +1,8 @@
 /* GNU dump extensions to tar.

    Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+   Foundation, Inc.

    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -1410,7 +1411,7 @@ write_directory_file (void)
   if (! fp)
     return;

-  if (fseek (fp, 0L, SEEK_SET) != 0)
+  if (fseeko (fp, 0L, SEEK_SET) != 0)
     seek_error (listed_incremental_option);
   if (sys_truncate (fileno (fp)) != 0)
     truncate_error (listed_incremental_option);
-- 
1.6.6





reply via email to

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