<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/truncate.c, branch v8.22</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.22</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.22'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2013-06-22T02:09:01Z</updated>
<entry>
<title>doc: clarify that truncate --size represents bytes by default</title>
<updated>2013-06-22T02:09:01Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-06-22T02:09:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b235223926c23f358df323fab4b368b46d0074af'/>
<id>urn:sha1:b235223926c23f358df323fab4b368b46d0074af</id>
<content type='text'>
* src/truncate.c (usage): Mention that --size is in bytes which
is by far the most common usage.
* doc/coreutils.texi (truncate invocation): Likewise. Also cross
reference the --io-blocks option.
Reported in http://bugs.gnu.org/14686
</content>
</entry>
<entry>
<title>maint: improve error messages upon failed read, write, access, close</title>
<updated>2013-02-06T15:57:34Z</updated>
<author>
<name>Benno Schulenberg</name>
<email>bensberg@justemail.net</email>
</author>
<published>2013-01-04T21:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=a1ee5cd714c0825b0244d09bbaa0a61c883ac18f'/>
<id>urn:sha1:a1ee5cd714c0825b0244d09bbaa0a61c883ac18f</id>
<content type='text'>
Note we use "failed to {access,close}" for those single operations,
and "error {read,writ}ing" for those partial operation failures.

* src/copy.c: Improve error messages for failing read, write and close.
* src/cp.c: Improve error messages for failing access.
* src/dd.c: Improve error messages for failing read, write and open.
* src/head.c: Improve error message for failing close.
* src/install.c: Improve error messages for failing access.
* src/ln.c: Likewise.
* src/mv.c: Likewise.
* src/touch.c: Improve error message for failing close.
* src/truncate.c: Likewise.
</content>
</entry>
<entry>
<title>maint: define usage note about mandatory args centrally</title>
<updated>2013-01-23T00:03:38Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2013-01-23T00:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4eaadb47430f21aee83eb920378be01945845a9a'/>
<id>urn:sha1:4eaadb47430f21aee83eb920378be01945845a9a</id>
<content type='text'>
Each program with at least one long option which is marked as
'required_argument' and which has also a short option for that
option, should print a note about mandatory arguments.
Define that well-known note centrally and use it rather than
literal printf/fputs, and add it where it was missing.

* src/system.h (emit_mandatory_arg_note): Add new function.

* src/cp.c (usage): Use it rather than literal printf/fputs.
* src/csplit.c, src/cut.c, src/date.c, src/df.c, src/du.c:
* src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/install.c:
* src/kill.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c:
* src/mknod.c, src/mv.c, src/nl.c, src/od.c, src/paste.c:
* src/pr.c, src/ptx.c, src/shred.c, src/shuf.c, src/sort.c:
* src/split.c, src/stdbuf.c, src/tac.c, src/tail.c, src/timeout.c:
* src/touch.c, src/truncate.c, src/unexpand.c, src/uniq.c:
Likewise.

* src/base64.c (usage): Add call of the above new function
because at least one long option has a required argument.
* src/basename.c, src/chcon.c, src/date.c, src/env.c:
* src/nice.c, src/runcon.c, src/seq.c, src/stat.c, src/stty.c:
Likewise.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2013-01-01T03:51:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2013-01-01T02:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=77da73c75432f3c5b4beebae7b0797a1e33160bc'/>
<id>urn:sha1:77da73c75432f3c5b4beebae7b0797a1e33160bc</id>
<content type='text'>
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
</content>
</entry>
<entry>
<title>truncate: don't leak a file descriptor with --ref=PIPE</title>
<updated>2012-08-04T10:27:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-08-04T09:02:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=cbd1cffa3eb9e6e5ca82ec67d3c4211a019dd1ed'/>
<id>urn:sha1:cbd1cffa3eb9e6e5ca82ec67d3c4211a019dd1ed</id>
<content type='text'>
* src/truncate.c (main): For a user who makes the mistake of
using a non-seekable file as a reference for the desired length,
truncate would open that file, attempt to seek to its end, but
upon seek failure would neglect to close the file descriptor.
Close the file descriptor even when lseek fails.
In addition, ignore failure to close that reference FD, since as
long as the lseek succeeds, a close failure doesn't matter.
Coverity spotted the potential FD leak.

Improved-by: Pádraig Brady.
</content>
</entry>
<entry>
<title>maint: refactor common mode bits used to create files</title>
<updated>2012-06-22T10:17:38Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2012-06-22T10:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=30a604e631291b80b9812e03e0f325489ae0d77e'/>
<id>urn:sha1:30a604e631291b80b9812e03e0f325489ae0d77e</id>
<content type='text'>
* src/system.h (MODE_RW_UGO): The new refactored define (666).
* src/mkfifo.c: Use the new define.
* src/mknod.c: Likewise.
* src/split.c: Likewise.
* src/system.h: Likewise.
* src/touch.c: Likewise.
* src/truncate.c: Likewise.

Suggested-by: Jim Meyering
</content>
</entry>
<entry>
<title>maint: handle file sizes more reliably</title>
<updated>2012-05-10T09:02:42Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2012-05-10T06:53:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9d308df13271a852aee7d46c65432fa84145ea31'/>
<id>urn:sha1:9d308df13271a852aee7d46c65432fa84145ea31</id>
<content type='text'>
Problem reported by Samuel Thibault in &lt;http://bugs.gnu.org/11424&gt;.
* NEWS: Document this.
* src/dd.c (skip): Handle skipping past EOF on shared or typed
memory objects the same way as with regular files.
(dd_copy): It's OK to truncate shared memory objects.
* src/du.c (duinfo_add): Check for overflow.
(print_only_size): Report overflow.
(process_file): Ignore negative file sizes in the --apparent-size case.
* src/od.c (skip): Fix comment about st_size.
* src/split.c (main):
* src/truncate.c (do_ftruncate, main):
On files where st_size is not portable, fall back on using lseek
with SEEK_END to determine the size.  Although strictly speaking
POSIX says the behavior is implementation-defined, in practice
if lseek returns a nonnegative value it's a reasonable one to
use for the file size.
* src/system.h (usable_st_size): Symlinks have reliable st_size too.
* tests/misc/truncate-dir-fail: Don't assume that getting the size
of a dir is not allowed, as it's now allowed on many platforms,
e.g., GNU/Linux.
</content>
</entry>
<entry>
<title>maint: src/*.c: change remaining quotes (without embedded spaces)</title>
<updated>2012-01-09T20:50:08Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-08T14:08:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=a517386f1bf8c64ee7617cc2c9d0a16a1d85c8c4'/>
<id>urn:sha1:a517386f1bf8c64ee7617cc2c9d0a16a1d85c8c4</id>
<content type='text'>
Run this (twice):
  git grep -E -l '`[^ ]+'\' src/*.c \
    |xargs perl -pi -e 's/`([^ ]+'\'')/'\''$1/'
</content>
</entry>
<entry>
<title>maint: convert `...' to '...' in --help output</title>
<updated>2012-01-09T20:50:08Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-08T13:08:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9af0dced5a2eb167ec7b9dfe3f358f214e45d41a'/>
<id>urn:sha1:9af0dced5a2eb167ec7b9dfe3f358f214e45d41a</id>
<content type='text'>
All affected lines end with \ or \n\, so run this command
until it produces no new changes (4 times):
  git grep -E -l '`[^ ]+'\''.*\\' src \
    |xargs perl -pi -e 's/`([^ ]+'\''.*\\)/'\''$1/'
</content>
</entry>
<entry>
<title>maint: prep for global quoting changes: handle irregular cases manually</title>
<updated>2012-01-09T20:49:51Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-09T20:33:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=84e742fab42ac270a1cbc548d4a6f6ac82c8124a'/>
<id>urn:sha1:84e742fab42ac270a1cbc548d4a6f6ac82c8124a</id>
<content type='text'>
* src/chroot.c (usage): Change ``...'' to '...', and describe the
default more accurately (also adding quotes): s,/bin/sh,'/bin/sh -i',
* src/join.c (usage): Change ` ...'' ' to "...''".
* src/fmt.c (isopen): Change `' to '` in list of bytes, so that
a subsequent change can safely perform the `...' to '...' conversion.
* src/truncate.c (main): Tweak quoting in comments to use '...',
not `...`, for consistency with the rest of comments in coreutils.
</content>
</entry>
</feed>
