Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 699461 Details for
Bug 912635
indent does not support 64-bit file systems
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Allow 64-bit stat
indent-2.2.11-Allow-64-bit-stat.patch (text/plain), 2.58 KB, created by
Petr Pisar
on 2013-02-19 14:07:02 UTC
(
hide
)
Description:
Allow 64-bit stat
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2013-02-19 14:07:02 UTC
Size:
2.58 KB
patch
obsolete
>From 7ef312f8a721b99469ea85e33e973475006c6a7f Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Tue, 19 Feb 2013 13:17:12 +0100 >Subject: [PATCH 2/2] Allow 64-bit stat > >--- > src/code_io.c | 38 ++++++++++++++++++++++++++++++++------ > src/indent.h | 2 +- > 2 files changed, 33 insertions(+), 7 deletions(-) > >diff --git a/src/code_io.c b/src/code_io.c >index 8c8fd41..8b93188 100644 >--- a/src/code_io.c >+++ b/src/code_io.c >@@ -50,6 +50,8 @@ > #include <unistd.h> > #endif > #include <string.h> >+#include <errno.h> >+#include <limits.h> > > #ifdef VMS > #include <file.h> >@@ -246,13 +248,18 @@ extern file_buffer_ty * read_file( > { > static file_buffer_ty fileptr = {NULL}; > >+#if defined(__MSDOS__) || defined(VMS) > /* > * size is required to be unsigned for MSDOS, > * in order to read files larger than 32767 > * bytes in a 16-bit world... > */ > >- unsigned int size; >+ unsigned int size, size_to_read; >+#else >+ ssize_t size; >+ size_t size_to_read; >+#endif > > int namelen = strlen(filename); > int fd = open(filename, O_RDONLY, 0777); >@@ -289,6 +296,10 @@ extern file_buffer_ty * read_file( > } > } > >+ if (file_stats->st_size > SSIZE_MAX) >+ { >+ fatal(_("File %s is too big to read"), filename); >+ } > fileptr.size = file_stats->st_size; > > if (fileptr.data != 0) >@@ -305,11 +316,26 @@ extern file_buffer_ty * read_file( > * newline. */ > } > >- size = INDENT_SYS_READ (fd, fileptr.data, fileptr.size); >- >- if (size == (unsigned int) -1) >- { >- fatal (_("Error reading input file %s"), filename); >+ size_to_read = fileptr.size; >+ while (size_to_read > 0) { >+ size = INDENT_SYS_READ (fd, fileptr.data + fileptr.size - size_to_read, >+ size_to_read); >+ >+ if (size == >+#if defined(__MSDOS__) || defined(VMS) >+ (unsigned int) >+#endif >+ -1) >+ { >+#if !defined(__MSDOS__) && !defined(VMS) >+ if (errno == EINTR) >+ { >+ continue; >+ } >+#endif >+ fatal (_("Error reading input file %s"), filename); >+ } >+ size_to_read -= size; > } > > if (close (fd) < 0) >diff --git a/src/indent.h b/src/indent.h >index 60ccb5a..bcb6b64 100644 >--- a/src/indent.h >+++ b/src/indent.h >@@ -106,7 +106,7 @@ typedef unsigned char BOOLEAN; > typedef struct file_buffer > { > char *name; >- unsigned long size; >+ size_t size; > char *data; > } file_buffer_ty; > >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 912635
: 699461