summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-01-24 07:08:58 +0000
committerRoland McGrath <roland@gnu.org>2000-01-24 07:08:58 +0000
commit97e8a8a72dcc1146b3ef3db4b2438eb11fab915c (patch)
tree14b3d62dcff71874fbe27b059c374c0d65423cfb /libdiskfs
parentb14110af8c96c5b021c1e27209608b032db7586e (diff)
2000-01-24 Roland McGrath <roland@baalperazim.frob.com>
* rdwr-internal.c (_diskfs_rdwr_internal): Short-circuit return for zero-length transfer to avoid side effects, as POSIX requires.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/rdwr-internal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libdiskfs/rdwr-internal.c b/libdiskfs/rdwr-internal.c
index 790fc12e..18a4ae1e 100644
--- a/libdiskfs/rdwr-internal.c
+++ b/libdiskfs/rdwr-internal.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation
+ Copyright (C) 1994,95,96,97,99,2000 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
@@ -41,6 +41,10 @@ _diskfs_rdwr_internal (struct node *np,
if (dir)
assert (!diskfs_readonly);
+ if (*amt == 0)
+ /* Zero-length writes do not update mtime or anything else, by POSIX. */
+ return 0;
+
if (!diskfs_check_readonly () && !notime)
{
if (dir)