summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-06-14 11:04:41 +0200
committerJim Meyering <meyering@redhat.com>2008-06-14 11:04:41 +0200
commitd42994df5d9deb7a5f6c43b5d171015535df8bcd (patch)
tree78b451e6a8d764f27387b26906fa303738d1b78f /src
parentd7d80c5b7b122377fe250357a3ab182e8fbde20a (diff)
downloadcoreutils-d42994df5d9deb7a5f6c43b5d171015535df8bcd.tar.xz
revert previous change, "don't use "const" with scalar types"
* src/truncate.c: There is nothing wrong with that construct. This reverts commit d7d80c5b7b122377fe250357a3ab182e8fbde20a.
Diffstat (limited to 'src')
-rw-r--r--src/truncate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/truncate.c b/src/truncate.c
index 32dc5d02e..f26fd45a8 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -143,7 +143,7 @@ do_ftruncate (int fd, char const *fname, off_t ssize, rel_mode_t rel_mode)
}
if (block_mode)
{
- size_t blksize = ST_BLKSIZE (sb);
+ size_t const blksize = ST_BLKSIZE (sb);
if (ssize < OFF_T_MIN / blksize || ssize > OFF_T_MAX / blksize)
{
error (0, 0,
@@ -156,7 +156,7 @@ do_ftruncate (int fd, char const *fname, off_t ssize, rel_mode_t rel_mode)
}
if (rel_mode)
{
- uintmax_t fsize = sb.st_size;
+ uintmax_t const fsize = sb.st_size;
if (sb.st_size < 0)
{
@@ -186,7 +186,7 @@ do_ftruncate (int fd, char const *fname, off_t ssize, rel_mode_t rel_mode)
/* 1..ssize -> ssize */
{
/* Here ssize>=1 && fsize>=0 */
- uintmax_t overflow = ((fsize + ssize - 1) / ssize) * ssize;
+ uintmax_t const overflow = ((fsize + ssize - 1) / ssize) * ssize;
if (overflow > OFF_T_MAX)
{
error (0, 0, _("overflow rounding up size of file %s"),
@@ -218,7 +218,7 @@ do_ftruncate (int fd, char const *fname, off_t ssize, rel_mode_t rel_mode)
specifies ftruncate's behavior only for these file types.
For example, do not complain when Linux 2.4 ftruncate
fails on /dev/fd0. */
- int ftruncate_errno = errno;
+ int const ftruncate_errno = errno;
if (fstat (fd, &sb) != 0)
{
error (0, errno, _("cannot fstat %s"), quote (fname));
@@ -365,7 +365,7 @@ main (int argc, char **argv)
`truncate -s0 .` should gen EISDIR error */
if (!(no_create && errno == ENOENT))
{
- int open_errno = errno;
+ int const open_errno = errno;
struct stat sb;
if (stat (fname, &sb) == 0)
{